Hi all,
I'm trying to build a flow for when an email arrives in a specific folder:
Get a specific word in the subject line (varSubject), then "Get Items" from a SharePoint list with a filter where Title eq 'varSubject'.
There should only ever be one item, but sometimes the word is not in the list.
So I want to perform a condition where if the item does not exist do X.
From the output of my Get Items action I create an HTML table.
Then I tried with a condition @empty(body('Create_HTML_table')) but it is always returning false.
Any ideas what I'm doing wrong? Or if you have a better/more logical way to approach this flow, let me know!
Thanks,
Sylvie
Solved! Go to Solution.
Hi @SylvieLet17,
Do you want to set a Condition that when Get items gets an item, configure the corresponding action in IF yes. Otherwise, don't set any action in If NO?
You could use length() function to determine if the items obtained by Get items are equal to 1, and then configure the following steps.
I have made a test on my side and the flow works well. Please take a try with the following workaround.
Image reference:
As for what you said "a condition @empty(body('Create_HTML_table')) but it is always returning false.", because even if there is no value in the HTML table, the output value of "body('Create_HTML_table')" is also will contain tags such as "<table><tbody></tbody></table>".
So empty() will always judge that this is not empty.
Please take a try and let me know if issue still exists.
Best Regards,
Barry
Hi @SylvieLet17,
Do you want to set a Condition that when Get items gets an item, configure the corresponding action in IF yes. Otherwise, don't set any action in If NO?
You could use length() function to determine if the items obtained by Get items are equal to 1, and then configure the following steps.
I have made a test on my side and the flow works well. Please take a try with the following workaround.
Image reference:
As for what you said "a condition @empty(body('Create_HTML_table')) but it is always returning false.", because even if there is no value in the HTML table, the output value of "body('Create_HTML_table')" is also will contain tags such as "<table><tbody></tbody></table>".
So empty() will always judge that this is not empty.
Please take a try and let me know if issue still exists.
Best Regards,
Barry
Hello, @SylvieLet17!
Thank you for posting on the Flow Community Forum! Have you had an opportunity to apply @v-bacao-msft‘s recommendation to adapt your Flow? If yes, and you find that solution to be satisfactory, please go ahead and click “Accept as Solution” so that this thread will be marked for other users to easily identify!
Thank you for being an active member of the Flow Community!
-Gabriel
Flow Community Manager
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.
If you are a small business ISV/Reseller, share your thoughts with our research team.
User | Count |
---|---|
26 | |
26 | |
25 | |
22 | |
14 |
User | Count |
---|---|
49 | |
37 | |
36 | |
31 | |
30 |