I've been searching for a way to verify if a date field is empty. It seems like there are many answers but none seems to work. It's truly maddening. I've been on this all day and can't tell if a date field is empty.
if(empty(@{triggerBody()['date']}),@{body('Get_file_current_properties')?['forDueDate']},@{triggerBody()['date']})
I'm trying empty() but that doesn't work.
Solved! Go to Solution.
please remove all @, {,} from your expression.
if(empty(triggerBody()?['date']),body('Get_file_current_properties')?['forDueDate'],triggerBody()?['date'])
Thanks
Hardesh
please remove all @, {,} from your expression.
if(empty(triggerBody()?['date']),body('Get_file_current_properties')?['forDueDate'],triggerBody()?['date'])
Thanks
Hardesh
It still gives me an error.
I rebuilt it a few times.
I'm new to using these functions so maybe I'm missing some syntax somewhere.
I am having trouble using the functions all together. Even on text or numbers.
The if function is: if(empty(),,)
None of these work
if(empty(triggerBody()['date']),body('Get_file_current_properties')?['forDueDate'],triggerBody()['date'])
if(empty(triggerBody()['text_1']),body('Get_file_current_properties')?['Title'],triggerBody()['text_1'])
if(empty(triggerBody()['number']),body('Get_file_current_properties')?['qaDatabaseID0'],triggerBody()['number'])
Do one thing..use compose action and add individual field from dynamic content. Copy compose input - do select all and copy. Then paste in notepad. This way you will get actual field expression. In notepad remove only @ sign and middle bracket from each expression. Now you will get each field expression then use formula.
Thanks
Hardesh
Please check my previous expression. In your expressions question mark is missing. Please match bit by bit.
Thanks
Hardesh
I'm testing now. Took a little while to come back to this. 🙂
Works on string:
if(empty(triggerBody()['text_1']),body('Get_file_current_properties')?['Title'],triggerBody()['text_1'])
Fails on a number.
if(empty(triggerBody()['number']),body('Get_file_current_properties')?['qaDatabaseID'],triggerBody()['number'])
It says empty expects a string,array,object.
Know how to test for an empty 'number'?
Marked as answer but still fails.
if(empty(triggerBody()['text_1']),body('Get_file_current_properties')?['Title'],triggerBody()['text_1'])
It fails because it says there is no value called [text_1] but it works when the value is populated.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
Read the latest about new experiences and capabilities in the Power Automate product blog.
At the monthly call, connect with other leaders and find out how community makes your experience even better.
User | Count |
---|---|
26 | |
25 | |
24 | |
22 | |
18 |
User | Count |
---|---|
58 | |
42 | |
36 | |
30 | |
30 |