cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Using if and empty expression and getting error

I am trying to populate a html table using the following expression. I case, if the cell content (date) is blank then i need nil in the table and in case it is not blank, i need it to return the date in a specific format.

 

if(empty(item()?['Checklist_sent_by_Auditor'], 'Pending', formatDateTime(adddays('1899-12-30',int(item()?['Checklist sent by Auditor'])), 'yyyy-MM-dd')))
 
error message
The execution of template action 'Create_HTML_table' failed. The column values could not be evaluated: 'The template language function 'if' expects three parameter: the condition to test as the first parameter, the value to return if the condition is true as the second parameter, and the value to return if the condition is false as the third parameter. The function was invoked with '1' parameter(s). Please see https://aka.ms/logicexpressions#if for usage details.'.
2 REPLIES 2
Anonymous
Not applicable

I was able to get the expresion work with minor tweak,

 

if(empty(item()?['Checklist_sent_by_Auditor']), 'Pending', formatDateTime(adddays('1899-12-30',int(item()?['Checklist sent by Auditor'])), 'yyyy-MM-dd'))
 
but i am getting 'pending' result for non blank cells also.. any workaround to get out of this issue?

 

Hi @Anonymous ,

 

Could you share the screenshot of the flow configuration so that we could provide a proper expression for you?

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,197)