cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
G99
Post Prodigy
Post Prodigy

Stuck in a previous working flow

Hi,

 

I'm unsure why this has happened, although I have my suspicion, I'm unsure how to fix it.

I had a previously working flow, which every morning sent an email with all the previous days items created in SP list.

I then had to format the time as it was adding in Z and T on the date and time field, so I added a convert time zone action but now rather than getting 1 email with all the previous days items, I am getting multiple emails for each item logged, but also in each email, the same item is mentioned 10 times:

This is my work flow, which sends the email:

G99_0-1618386414690.png

 

This is my complete flow:

 

G99_1-1618386502452.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Then let's add another expression. 🙂 formatDateTime(...) will format a date in a desired format

formatDateTime(convertFromUtc(item()?['Date_x0026_Time'], 'GMT Standard Time'),'f')

You can find more formats in this article if you'd like, the expression above is using the 'f' format, the one you used in the action: Standard date and time format strings | Microsoft Docs

 



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

View solution in original post

10 REPLIES 10
tom_riha
Super User
Super User

Hello @G99 ,

my suspicion would be the 'Apply to each' in your flow. It's looping through all the items from 'Get items' and for each of them repeating all the steps inside. I suppose it was added together with the 'Convert time zone' action that wants to convert timezone for all the items in a loop.

Get rid of the 'Convert time zone' action and the 'Apply to each', and use an expression instead in the 'Select' (I guess that's where you select data for the HTML table). The expression should look like:

convertFromUtc([TheDate&TimeDynamicContent], 'GMT Standard Time')

 



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

Hi @tom_riha 

Yes You are right, its the apply to each which is causing the issue, but when I remove the Apply to each and convert time zone actions and try to use the expression, i oddly cannot select any dynamic content I only have 2 body and value to select from, I have a 3rd an unsure what that is:

 

G99_0-1618413141078.png

 

You can still type it in even if it's not visible in the format below:

item()?['ColumnInternalName']

Just replace the ColumnInternalName with the internal name of the 'Date & Time' column, you can get it from the column settings URL if you open the 'Edit column' page in SharePoint.

image.png



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

Thanks

 

do i still need to write the expression like this with item()?['Date_x0026_Time']

G99_0-1618414072581.png

 

If yes, how do I alter the expression you have provided, sorry havent worked much with expressions

It should look like this, adding the item()?... into the expression on the place for the dynamic content:

convertFromUtc(item()?['Date_x0026_Time'], 'GMT Standard Time')

 



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]
G99
Post Prodigy
Post Prodigy

@tom_riha 

Yes so that works, but then I'm back to my original problem (sorry you were not involved with helping me on that) with the formatting of the date, the reason I put convert time zone was to remove the odd formatting visible in the snippet, but now its back:

 

G99_0-1618414614348.png

 

Then let's add another expression. 🙂 formatDateTime(...) will format a date in a desired format

formatDateTime(convertFromUtc(item()?['Date_x0026_Time'], 'GMT Standard Time'),'f')

You can find more formats in this article if you'd like, the expression above is using the 'f' format, the one you used in the action: Standard date and time format strings | Microsoft Docs

 



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

View solution in original post

G99
Post Prodigy
Post Prodigy

@tom_riha 

Came across something like this, but the flow now fails:

 

convertFromUtc(item()?['Date_x0026_Time'], 'UTC''GMT Standard Time''HH:mm')

It's because the 'convertFromUtc' already has the 'UTC' information inside and expects just 3 parameters. You can take the expression as I shared it in the previous post.



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

I hadn't seen your response when I was trying, That works Thanks so much for your help
Now I need to see how I can get attachments added as part of this workflow - I have a separate question logged if you could help it would be amazing:

Adding attachment(s) or link to attachment(s) - Power Platform Community (microsoft.com)

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (1,264)