cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
flowArcade
New Member

Comparing a Form-Date with current Date in a if-condition

Hello,

 

i am new to flow and want to compare a date from a input of a Forms-Document with the current date

 

To get the current date i used this function: 

formatDateTime(triggerBody()?['createdon'], 'yyyy-MM-dd')
 
flowArcade_0-1642578850671.png

if-else condition: when the Forms-Date is equal to the current date OR the approvals are all 'approved', than...

 
Probably one of these Date Formats are wrong so its not possible to compare but i didnt know how to fix it.
 
This is the error when the flow is starting:
flowArcade_2-1642579151957.png

English: Unable to process template language expressions for action "condition" in row "1" and column "37392": The template language function "formatDateTime" expects a parameter of type "string" as first parameter. The specified value is of type "Null".


 

Best Regards and thank you!
J.
1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Super User
Super User

Hi @flowArcade,

 

You are using the When a response is submitted trigger action, correct? I don't think that action has a createdon field in the body. I do see the eventTime which is a datetime field.

 

Can you try that field instead:

formatDateTime(triggerBody()?['eventTime'], 'yyyy-MM-dd')

 

You might also want to check the formatting on the Bis wann field in the left side of the condition. Maybe you need to apply formatting to that field to in order to match the same yyyy-MM-dd format.

View solution in original post

2 REPLIES 2
Expiscornovus
Super User
Super User

Hi @flowArcade,

 

You are using the When a response is submitted trigger action, correct? I don't think that action has a createdon field in the body. I do see the eventTime which is a datetime field.

 

Can you try that field instead:

formatDateTime(triggerBody()?['eventTime'], 'yyyy-MM-dd')

 

You might also want to check the formatting on the Bis wann field in the left side of the condition. Maybe you need to apply formatting to that field to in order to match the same yyyy-MM-dd format.

Thank you so much! It works fine now 😊

Helpful resources

Announcements
Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (2,355)