cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JosuOte
Frequent Visitor

Calendar element without set time

Hi, 

 

I'm quite new to flows with Power Automate and I was creating a flow that will substitute anothter flow created with sharepoint that is giving issues. The main thing is that I am able to create this events on the calendar, but the event gets created at 1:00, and the old ones get created at no specific time, just the day is set. In the picture below you can see the old event and the new one.

calendar.png

And here you can see the way the flow is created, the event is basically created x days after a new element in a list is created. In this case its created after 30 days, and the expresions looks like this:

 

addDays(triggerOutputs()?['body/Nueva_x0020_columna1'],30)

 

Where I add the date in a column and in this case the number 30.

 

flow.png

 

If you guys have any idea on what might be the issue with this let me know, and if any more information is needed please ask for it. Thank you very much in advance,

 

JosuOte

1 ACCEPTED SOLUTION

Accepted Solutions
v-litu-msft
Community Support
Community Support

Hi @JosuOte,

 

OK, so you want to create an all-day event, right?

You could use the Send HTTP request to SharePoint action to create an event, and you could set all day property in there:

 

Uri:

_api/web/lists/getByTitle('CalendarName')/items

Headers:

{
  "accept": "application/json;odata=verbose",
  "content-type": "application/json;odata=verbose"
}

Body:

{
"__metadata": {
"type" : "SP.Data.CalendarNameListItem"},
"Title": "TestAllDay",
"fAllDayEvent" : "True",
"EventDate" :"@{variables('Date')}",
"EndDate" :"@{variables('Date')}"
}

Screenshot 2021-03-01 175153.jpg

 

 

Run result:Screenshot 2021-03-01 174931.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

8 REPLIES 8
v-litu-msft
Community Support
Community Support

Hi @JosuOte,

 

Thank you for posting.

According to your description, you would like to set the time to a specified date and remove the fixed time. If I misunderstood, please kindly let me know.

You could use the addDays() function to approach that, in the third parameter you could set the time format to "yyyy-MM-dd":

addDays(triggerOutputs()?['body/Nueva_x0020_columna1'], 30, 'yyyy-MM-dd')

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for the response,

 

I'm afraid I dindnt explain myself well enough, sorry for that. Just in case I tried the solution given but the result was not what I needed.

Both events are totally unrelated one from the other, the new flow that I'm trying to make is independent from the old one, so once working the other will be deleted. The issue I'm facing is that I dont know how to create an event where the event is not set at a specific time of the day but its just set for that day. As can be seen in the "old alert" just as an example. My new event is automatically created at 1:00 am but I need it to not be for a especific time. If I didnt explain mysefl, feel free to ask any questions.

 

Thank you very much for the response.

v-litu-msft
Community Support
Community Support

Hi @JosuOte,

 

OK, so you want to create an all-day event, right?

You could use the Send HTTP request to SharePoint action to create an event, and you could set all day property in there:

 

Uri:

_api/web/lists/getByTitle('CalendarName')/items

Headers:

{
  "accept": "application/json;odata=verbose",
  "content-type": "application/json;odata=verbose"
}

Body:

{
"__metadata": {
"type" : "SP.Data.CalendarNameListItem"},
"Title": "TestAllDay",
"fAllDayEvent" : "True",
"EventDate" :"@{variables('Date')}",
"EndDate" :"@{variables('Date')}"
}

Screenshot 2021-03-01 175153.jpg

 

 

Run result:Screenshot 2021-03-01 174931.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Thanks for the quick response,

 

Yeah, thats exaclty what I need, so I tried to copy what you just mentioned and doesnt seem to work, a couple of questions. The only variables that need to be changed for this to work are the "calendar name" in "uri" and the site address right? The other one, the initialize variable comes right after the "after creating an elemet" block or does it go anywere else. I will attach a picture with what I tried and next to it my first attemp. If I didnt mention it earlier these blocks are executed after a "after creating element" item.

httprequest.PNG

I am sorry if I im missing something, just a beginer with flows,

 

Thanks 

 

JosuOte

v-litu-msft
Community Support
Community Support

Hi @JosuOte,

 

The type property in the body is not correct:

{
"__metadata": {
"type" : "SP.Data.CalendarNameListItem"},
"Title": "TestAllDay",
"fAllDayEvent" : "True",
"EventDate" :"@{variables('Date')}",
"EndDate" :"@{variables('Date')}"
}

For example, if your calendar list is named "Calendar List1", the type should be "SP.Data.CalendarList1ListItem". We should remove these blank spaces in the Calendar name.

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Thanks for the response,

 

I still cant manage to make it work. But whith what you said, in the "URI" part, does the name of the calendar also need to have no spaces? or doesnt matter there.

 

For ease of help, the name of the calendar is "Calendario dep. Facility".

calendar-name.PNG

 


Thanks,

 

JosuOte

v-litu-msft
Community Support
Community Support

Hi @JosuOte,

 

The dot in the Sharepoint list will make the HTTP request failed, could you please try another list?

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

JosuOte
Frequent Visitor

Hi @v-litu-msft 

 

That was the issue yes, that is what I needed, unfortunately I wont be able to change the name of the list. At least now I know how to create all day events in case I need it in the future.

 

Thank you very much for the help,

 

JosuOte

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,787)