Hi,
I've been working on a Flow that has the function of sending an Excel sheet last weekday of every month.
I got most working but im struggeling with getting the below piece of the puzzle to function correctly. I need the function below to calculate the last weekday of the given month and display it as this: 2018-08-17T06:31 currently im getting the last day of the month not last weekday and an output looking like this: 2018-08-31T08:00:00.0000000Z so the red needs to be removed.
"@adddays(concat(add(int(formatDateTime(utcNow(), 'yyyy')),if(equals(formatDateTime(utcNow(), 'MM'), '12'), 1, 0) ),'-',add(int(formatDateTime(utcNow(), 'MM')),if(equals(formatDateTime(utcNow(), 'MM'), '12'), -11, 1) ),'-01T08:00Z'),-1)"
Im using utcnow to let the function now what day, month and time it currently is.
Solved! Go to Solution.
Hi @ jimmyDK,
You could use the formatDateTime function to format your results to achieve the display you want.
Use the formatDateTime function on the basis of your expression, as below:
formatDateTime(adddays(concat(add(int(formatDateTime(utcNow(), 'yyyy')), if(equals(formatDateTime(utcNow(), 'MM'), '12'), 1, 0) ), '-', add(int(formatDateTime(utcNow(), 'MM')), if(equals(formatDateTime(utcNow(), 'MM'), '12'), -11, 1) ),'-01T08:00Z'),-1),'yyyy-MM-ddTHH:mm')
I have made a test on my side, as below:
The result is as below:
Please take a try and let me know if any issue exists.
Best Regards,
Barry
Hi @ jimmyDK,
You could use the formatDateTime function to format your results to achieve the display you want.
Use the formatDateTime function on the basis of your expression, as below:
formatDateTime(adddays(concat(add(int(formatDateTime(utcNow(), 'yyyy')), if(equals(formatDateTime(utcNow(), 'MM'), '12'), 1, 0) ), '-', add(int(formatDateTime(utcNow(), 'MM')), if(equals(formatDateTime(utcNow(), 'MM'), '12'), -11, 1) ),'-01T08:00Z'),-1),'yyyy-MM-ddTHH:mm')
I have made a test on my side, as below:
The result is as below:
Please take a try and let me know if any issue exists.
Best Regards,
Barry
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
12 | |
11 | |
10 | |
9 | |
6 |
User | Count |
---|---|
26 | |
20 | |
12 | |
10 | |
7 |