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.
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.
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
Solved! Go to Solution.
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')}"
}
Run result:
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 @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.
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')}"
}
Run result:
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 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.
I am sorry if I im missing something, just a beginer with flows,
Thanks
JosuOte
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".
Thanks,
JosuOte
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.
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
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Announcing a new way to share your feedback with the Power Automate Team.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
72 | |
22 | |
17 | |
17 | |
14 |
User | Count |
---|---|
125 | |
35 | |
30 | |
28 | |
26 |