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

Date formatting issue in Output

Hello, please help!

 

I am trying to build a Flow (to replace a 2010 workflow). The process is:

 

1. Date field completed when new item is created in List#1, an additional calculated column in List#1 converts date to show 'day of week'

2. Flow checks the 'day of week' calculated column.  If it's a Friday, 3 days are added, if it's any other day, 1 day is added - the result is entered into a variable 'sDate'. 

3. The Flow then populates a column in List#2 with the content of 'sDate'.

 

The issue I have is that the output is showing in the wrong format. I can see through the Flow that at all stages the format is correct  for what I want - (dd/MM/yyyy), right up until the output of the 'Update Item'. The input shows correctly, but the output shows incorrectly and therefore completely changes the date that is shown:

 

 This is the input...

tjlovett_0-1600769363489.png  - 7th September 2020 - correct!

 

...and this is the output from the same 'Update Item':

tjlovett_1-1600769408625.png  - 9th July 2020 - not correct ☹️

 

I have added a 'Compose' before the 'Update Item' which contains the variable, then added the Output from that 'Compose' to the column in the 'Update Item':

 

tjlovett_2-1600769546776.png

 

tjlovett_3-1600769598395.png

 

I don't understand how the input can be showing correctly and the output showing incorrectly in the Update Item?  Do I need to add a formatDateTime expression instead of the Dynamic content / 'Outputs' (from the 'Compose'), as above? I have played around with doing this but keep getting errors.  

 

Any assistance to steer me in the right direction would be gratefully received!

 

Many thanks!

1 ACCEPTED SOLUTION

Accepted Solutions

Thank you for your help. I couldn't quite get it working from your suggestion - I tried various incarnations of the expression, not sure what I was doing wrong, but that led me to add the following in the Compose, which weirdly, does result in the correct formatting being applied for the column in question:

 

addDays(variables('sDate'),0, 'dd/MM/yyyy').

 

Thank you for your assistance 😊

View solution in original post

2 REPLIES 2
rsaikrishna
Community Champion
Community Champion

@tjlovett 

 

07/09/2020 - You are thinking this as 7th September 2020 but it seems to be considering 9th July as input.

 

use formateDateTime(<sDate field>,'mm/dd/yyyy') in the Compose and then use the out put in your Update action.

 

Alternatively, you can also try using DateTime connector actions. This connector provides you many Date and Time actions.

 

Regards

Krishna Rachakonda

If this reply helped you to solve the issue, please mark the post as Accepted SolutionMarking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone.

 

 

Thank you for your help. I couldn't quite get it working from your suggestion - I tried various incarnations of the expression, not sure what I was doing wrong, but that led me to add the following in the Compose, which weirdly, does result in the correct formatting being applied for the column in question:

 

addDays(variables('sDate'),0, 'dd/MM/yyyy').

 

Thank you for your assistance 😊

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (1,609)