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:
This is my complete flow:
Solved! Go to Solution.
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
Hello @Anonymous ,
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')
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:
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.
Thanks
do i still need to write the expression like this with item()?['Date_x0026_Time']
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')
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:
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
@tom_riha
Came across something like this, but the flow now fails:
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.
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)
User | Count |
---|---|
89 | |
40 | |
22 | |
20 | |
16 |
User | Count |
---|---|
134 | |
54 | |
47 | |
36 | |
25 |