cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
onyebuchiboss
Level: Powered On

Trying to date time in my query in flow, bt getting the error - must match ISO 8601 format

I have the following in my query: 

sheduled ge addDays('[scheduledend]',14),  but getting the error , must match ISO format. is anything wrong in that function. @RezaDorrani , pls can you take a look for me. The rquirement is to update record 14days after scheduled end day. 
 
Cheers.
2 ACCEPTED SOLUTIONS

Accepted Solutions
Dual Super User
Dual Super User

Re: Trying to date time in my query in flow, bt getting the error - must match ISO 8601 format

Hi @onyebuchiboss 

 

Yes you can do that. But AND will not work in your case you should use or:

statuscode eq 0 or statuscode eq 3

View solution in original post

Dual Super User
Dual Super User

Re: Trying to date time in my query in flow, bt getting the error - must match ISO 8601 format

Hey @onyebuchiboss 

 

Glad that I was of some help. BTW, I just realised, we can probably, do the filter for the date and then put the condition on the status code. 

As the status code will be common but then the date will filter more. 

 

It is just a matter of good practice/bad practice but  both the solutions just work fine. 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

22 REPLIES 22
Dual Super User
Dual Super User

Re: Trying to date time in my query in flow, bt getting the error - must match ISO 8601 format

Hi @onyebuchiboss 

 

Can you please share what is the format of the date in 'scheduledend'

 

You can try modifying the expression as: 

formatDateTime(addDays('[scheduledend]',14),'yyyy-MM-ddThh:mm:ssZ')

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

onyebuchiboss
Level: Powered On

Re: Trying to date time in my query in flow, bt getting the error - must match ISO 8601 format

@yashag2255 The scheduled date formate is - 29/07/2019 23:30.  its in GMT.

onyebuchiboss
Level: Powered On

Re: Trying to date time in my query in flow, bt getting the error - must match ISO 8601 format

@yashag2255 I have tried using your Format above, but its still not working. I am using utcNow() ge 

formatDateTime(addDays('[scheduledend]',14),'yyyy-MM-ddThh:mm:ssZ'), and its still failing.
Dual Super User
Dual Super User

Re: Trying to date time in my query in flow, bt getting the error - must match ISO 8601 format

@onyebuchiboss 

 

The adddays function expects the first string in the ISO 8601 format. The date format that you have shown is not of that format. You need to first convert it to the appropriate format before the add days function. 

 

I have used variables to modify the date time as ISO 8601 format to the date string that you have shared:

ssw.PNG

Expressions: 

1. split(first(split(variables('f'),' ')),'/')
2. concat(variables('test')[2],'-',variables('test')[1],'-',variables('test')[0])
3. addDays(variables('ee'),12)

Carefully note the variable names in the expressions. 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

onyebuchiboss
Level: Powered On

Re: Trying to date time in my query in flow, bt getting the error - must match ISO 8601 format

@yashag2255 isn't the string in the first initiliase variable suppose to be the vriable from my date, u' only passing the plain string ?

Dual Super User
Dual Super User

Re: Trying to date time in my query in flow, bt getting the error - must match ISO 8601 format

Hi @onyebuchiboss 

 

Yep. I just passed the plain string. That will be the date field from the data source (basically you can just select the scheduled date field from the dynamic selector if you are extracting that value from any previous steps)

onyebuchiboss
Level: Powered On

Re: Trying to date time in my query in flow, bt getting the error - must match ISO 8601 format

@yashag2255 thats the problem, my previous step is just a reoccurence, and when i try to use this after my next action - List Records, its throwing this error - "The variable action 'Initialize_variable' of type 'InitializeVariable' cannot be nested in an action of type 'Apply_to_each_2'.".  why is Flow is so complicated.

Dual Super User
Dual Super User

Re: Trying to date time in my query in flow, bt getting the error - must match ISO 8601 format

@onyebuchiboss 

 

Can you please share a screenshot of the entire flow? That way it will be easier to identify the issue and better assist you with this. 

 

onyebuchiboss
Level: Powered On

Re: Trying to date time in my query in flow, bt getting the error - must match ISO 8601 format

@yashag2255 Please look at the image below:

The requirement is to get all the record and update each one with its scheduledend date field x days after the entered date.

capture.png

onyebuchiboss
Level: Powered On

Re: Trying to date time in my query in flow, bt getting the error - must match ISO 8601 format

@yashag2255 I posted the image ou asked for?

Dual Super User
Dual Super User

Re: Trying to date time in my query in flow, bt getting the error - must match ISO 8601 format

Hi @onyebuchiboss 

 

I missed your message somehow. Can you please also share a screenshot of the List Records action? That is where you must be writing the query right? 

Dual Super User
Dual Super User

Re: Trying to date time in my query in flow, bt getting the error - must match ISO 8601 format

Hi @onyebuchiboss 

 

I get your issue now. So basically you want to extract the date from the Recurrence Trigger? That is currently not supported. If you want to check the trigger time, and compare that value, you can better use the utcnow(). 

 

The expression would be: 

addDays(utcnow(),14)
dds.PNG

You need to replace the cre4dge_duedate with the name of the field that you want to compare this to. 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

onyebuchiboss
Level: Powered On

Re: Trying to date time in my query in flow, bt getting the error - must match ISO 8601 format

@yashag2255 The requirement which is to update all the record 14 days after the scheduledend date, should the function in the query be something like "scheduledend ge (scheduled+14days)" or does your function do same thing ?

Dual Super User
Dual Super User

Re: Trying to date time in my query in flow, bt getting the error - must match ISO 8601 format

Hi @onyebuchiboss 

 

So do you mean that you want to update the records that have the scheduledend date value as 14 days more than the scheduled date? 

 

Do you have the fields Sheduled End Date and Scheduled Date in your entity? 

 

Can you please confirm these? I am guessing that you have those fields and if so, then you have to alter your query a bit. Can you also share an expanded screenshot of the List Records action and the Update Action? 

 

 

onyebuchiboss
Level: Powered On

Re: Trying to date time in my query in flow, bt getting the error - must match ISO 8601 format

Hi @yashag2255 Yes I have the field in my entity, sorry if i am mixing the field name up, I only want to use the "scheduleend" field(its a date field). Like i mentioned , i want to check if the date is 14days older e.g User entered 01/08/2019, i want to get all the record that are still active on the 15/08/2018 (but the scheduledend is 01/08/2019). For the active part, i will put that in the condition Action, once the records has been retrieved. 

Dual Super User
Dual Super User

Re: Trying to date time in my query in flow, bt getting the error - must match ISO 8601 format

@onyebuchiboss 

 

Can you confirm how the user enters that date? o you want the user to enter the date in flow?

onyebuchiboss
Level: Powered On

Re: Trying to date time in my query in flow, bt getting the error - must match ISO 8601 format

@yashag2255 sorry, i was just making an exmaple. But dates are entered manually when a record is created. So the entity i am working with an appointment, in appointment we have scheduledend and scheduledstart (both date field), the requirement is to get all the record that still Open 14days after the date entered in the scheduledend. It looks basic  but.....

Dual Super User
Dual Super User

Re: Trying to date time in my query in flow, bt getting the error - must match ISO 8601 format

Hi @onyebuchiboss 

 

This is how I am doing it now: jkls.PNG

 

This will first fetch all open records and then check the actual end date with today's date minus 14 days and if the actual end date is less than that then you can perofrm the action. This will run every daya nd find any open records that have active status and the scheduled end date was 2 weeks ago from today. 

Expression:  

adddays(utcnow(),14)

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

onyebuchiboss
Level: Powered On

Re: Trying to date time in my query in flow, bt getting the error - must match ISO 8601 format

@yashag2255 Thanks, we are almost there, you know the status for appointment entity when active can be either Open(0) or Scheduled(3), is it possible to use and AND (&&) operator in the filter query at all?

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (4,755)