cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
gazzo1967
Impactful Individual
Impactful Individual

Compose date and time to Create item to Sharepoint Calendar

HI All
I need some help with a flow
I have a flow that when a list item is created it does the following:

Capture.JPG

 

My sharepoint list stores the date in a datepicker field
but my time field is single line text.
When i create item - Create calender item

 

As you can see the Event date and time start and finish are entered but the output time is 7hrs earlier

Capture1.JPG

but the output time is 7hrs earlier

Capture2.JPG

 

I take it i have to convert the dates to UTC before using them in my create Calendar item
This i dont know how to do 😞

 

Regards Gary

 

12 REPLIES 12
efialttes
Super User III
Super User III

Hi!

Did you tried with this action block, please note the values assigned in the screenshot are from a different project:

Flow_TimeZone.PNG

Please be careful and keep 'Format string' as the one you originally has in your traces, select your own source time zone, and select as destination time zone UTC.

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



gazzo1967
Impactful Individual
Impactful Individual

@efialttes 

Thank you for the response

My date and time are in 2 different fields in sharepoint list and i am joining them this way in my create item.

Capture3.JPG

the time from my sharepoint list is the correct time entry so do i have to work out the difference for example i am in UTC 00:00 Dublin London etc

I have set Convert Time 

Capture.JPG
This is the output

Capture.JPG

As you can see in my create item INput its the correct time
Capture.JPG
But the output changes!


Capture.JPG

 

Gary

 

gazzo1967
Impactful Individual
Impactful Individual

i also assume that UK Daylight savings cause issues!

Hi!
Is your Convert Time Zone actually converting the time?

I hate to do this, but sometimes there is no other way but using addHours() to fix theses issues
https://powerusers.microsoft.com/t5/Building-Flows/Converting-time-zones-Sharepoint-List-to-Flow/td-...

Thanx!


Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



gazzo1967
Impactful Individual
Impactful Individual

@efialttes 

Yes it does these are the outputs after conversion 

Capture.JPG
 
But as soon as i create new list item the output times are changed
 
Capture1.JPGCapture.JPG
thank you for you help with this 🙂 I cant understand why the create item is changing the times..
I have checked the regional settings for the sharepoint site and they are correct!
 
This would be so much simpler if i could find the sharepoint calendar ID  so i could use the 'create eventV4' lol
but i guess that doesnt work with Sharepoint calendar as its essentially a List?

Gary

Hi @gazzo1967,

 

There is no concept of daylight saving time and time zone in Flow. When creating an item in SharePoint, it will default to Universal time. So, when you create an item, you should convert it by using Expression or Convert time zone action.

We often use the methods given by @efialttes. You need to pay more attention to this when you use Flow in the future. I hope you can enjoy using Flow.

 

Best Regards,
Community Support Team _ Lin Tu

gazzo1967
Impactful Individual
Impactful Individual

@v-litu-msft 

Ok thank you for your response but then explain to me when i am using Convert time that the correct time is being inputted into my create item (to a sharepoint calendar) but the output adds an hour?
My regional settings are all correct.

I understand teh methods that @efialttes has explained to me but nothing is working!
I have even rebuilt the flow!

Regards Gary

Hi @gazzo1967,

 

When the hour added in the SharePoint, cause SharePoint has daylight saving, so the return of the SharePoint will add an hour.

 

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.

gazzo1967
Impactful Individual
Impactful Individual

@v-litu-msft 

So what is your recommendation to make this work correctly?
The data and time are from one Sharepoint list on the same site!

 

It only changes the time between the create item input and output

 

Just looking into my columns and i notice that i have the date in one column (date Only) but the time is in a single line of text column would this make a difference?

 

Can i use the Create event action with a sharepoint calendar?
If so how do i get the sharepoint calendar ID?

 

Gary

Hi @gazzo1967,

 

The only way to solve the time issue for now is using the addHour() function, if it less 7 hours, when you append the date in, add 7 Hours in the Start Date and End Date.

If you store the Date in the single text, it will not different from stored in a Date column if you just for the view. However, if you want to create a calendar column based on it, it will unavailable.

 

Actually, the SharePoint calendar is a SharePoint list, you could use the create item to do it.

If so, you could use Get items or Get item action in the SharePoint connector to get the calendar ID.

 

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 @gazzo1967,

 

The Calendar wouldn't appear in the list name, you could enter a custom name into it:

 

Annotation 2020-04-20 165439.png

 

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.

gazzo1967
Impactful Individual
Impactful Individual

@v-litu-msft 

 

Thank you for the response.

 

i am using Get Item as it is one record that needs to created

 

If you look at the previous parts of the thread you suggestion is exactly what i a doing but the create item in the calendar(custom list) is adding an hour to my times when i don't need it too.

The original list where powerapps is sending the information gathered is on the same sharepoint as the calendar.

as you can understand i do not want to have to keep adjusting the outputs from powerapps twice a year to account for this as the whole idea is to automate the process.

Helpful resources

Announcements
MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (57,066)