Create an Event in calender list on adding an Item to custom list?

  • 15 April 2020
  • 1 reply
  • 3 views

Badge

Hi,

    I have a custom list named Photography . It contains one field 'Start Date' which is date time.

Also i have a calender list in the same site. I need to create a calender event when we are adding an item in Photography list. The calender event time has to be Start Date. How i can do this? I have workflow for Photography list. Please help me.

Thanks


1 reply

Badge +7

What you're asking can be done, but I'd like to dig a litle further into your solution first.

 

Why do you need the two separate lists? A calendar is a list so, any list that has even one date field can have a calendar view. OR, you could simply use a Calendar list template to create your list and it'll have the required fields for a calendar item. Then you can simply add a view to show all events in a list-type view rather than a calendar view.

 

Remember, if you have two separate lists with the same data, you need to maintain them both. What if you need to change a date on the first list? You'll need to incorporate a solution in your workflow(s) to update the corresponding item in the second list as well.

 

Since you're only using one date field (Start Date), I would suggest using that for both the beginning and ending interval in the calendar view, or if you want to get a little fancy, you could add an End Date field that gets populated by a simple workflow so every calendar item is the same length of time.

 

One list with multiple views is going to be the best option here, unless there are other requirements you haven't shared.

 

--------------------------------------------------------------

 

Now, to answer your initial question, if you do want to keep the two separate lists, simply create a list workflow on the Photography list. When an item is created, have it use the Create Item action and point it to the calendar list. Make sure to map the correct fields (Start Date).


That's all you need for the most basic solution. However, like I mentioned above, if you also need to sync your modifications, you'll want to build it out a little further.

 

In the Photography list, you'll also want to add a column to hold the calendar list item's ID. Then, in your workflow, in the Create Item action, you'll need to create a variable to hold the "Store new item ID in" value. 

 

7298i30B410FEA6EDD41D.png

 

After the Create Item action, add an Update Item action, and set it to update the current item in the Photography list's ID field to the value you captured from the Create Item action.

 

Now, either in another workflow or if you setup a Set Condition action properly, you'll want to use an Update Item action to update the calendar item whenever the Photography item is updated. To do this, you'll want to use that ID you captured so you update the corresponding item in the other list.

 

This is why I would suggest simply using a calendar view on the Photography list. It will be much simpler and easier to maintain.

Reply