Step 1
Step 2
Step 3
Step 3 & 4
Step 5 & 6
Step 7 & 8
Step 9 & 10
Step 11 & 12
Step 13, 14, 15
Step 16
hello,
I am new to flow and I am using the standard template "Create a daily summary of planner tasks by bucket" I cannot figure out how to get the date to format to MM/dd/yyyy rather than the string that is coming over 2019-04-30T10:00:00Z.
I have tried all of the previous suggestions on this forum. Not sure if I am just not putting it in the right place. I also have 3 fields that I need to convert the time.
StartDate
DueDate
CompletedDate
Solved! Go to Solution.
Hi @cmr579 ,
Please take a try with the following code, which will return blank if the item is empty, otherwise, return its exact date.
if(empty(items('Iterate_through_tasks')?['completedDateTime']),'',formatdatetime(items('Iterate_through_tasks')?['completedDateTime'],'MM/dd/yyyy'))
Best regards,
Mabel
Hi @cmr579 ,
Do you want to format the StartDate, DueDate, CompletedDate to format of “MM/dd/yyyy”?
In the action Set TaskDetails variable, please set them separately with the following functions:
StartDate:
formatdatetime(items('Iterate_through_tasks')?['startDateTime'],'MM/dd/yyyy')
DueDate:
formatdatetime(items('Iterate_through_tasks')?['dueDateTime'],'MM/dd/yyyy')
CompletedDate:
formatdatetime(items('Iterate_through_tasks')?['completedDateTime'],'MM/dd/yyyy')
I have tested it on my side successfully.
Best regards,
Mabel
I added the content that you provided and I think it brought me alot closer. However, it failed because I do have some values which are null meaning they may not have start dates, due dates or completed dates. Do you have a recommendation to write to include strings that have no dates?
I am attaching the error message I received.
Hi @cmr579 ,
Please take a try with the following code, which will return blank if the item is empty, otherwise, return its exact date.
if(empty(items('Iterate_through_tasks')?['completedDateTime']),'',formatdatetime(items('Iterate_through_tasks')?['completedDateTime'],'MM/dd/yyyy'))
Best regards,
Mabel
I'm having the same issue as OP, and am working through the suggestions in this thread. I tried the suggestion for the "formatdatetime" variables, and ran into the same problem with my flows as I do have Null values. I then went on to try Mabel's "if" code, but im getting the error "enter a valid json". Does anyone have any further ideas how this might be achievable?
I've done a bit of trawling and can see generally how you could go about formatting dates, but haven't been able to work out a way to do this within this flow's Set TaskDetails variable. Thanks!
Tom
User | Count |
---|---|
85 | |
37 | |
23 | |
20 | |
16 |
User | Count |
---|---|
127 | |
49 | |
46 | |
27 | |
25 |