Hi ElsieLu-MSFT. Thanks for letting me know.
Ryan
Checking for empty column in array of documents in Power Automate/SharePoint
I have a flow that sends any document in a specific folder through an approval process.
The approvers for my approval process are determined by a column called 'Approvers' containing people. Each document should have 'Approvers' configured.
I am checking each document to make sure that 'Approvers' column is not empty.
I use a condition to do this:
empty(triggerBody()?['Approvers'])
If I test this condition outside of the loop on individual files, it works fine. However in the 'Apply to each' loop like below, it always evaluates 'true'.
I guess it has something to do with my use of 'value' in 'Apply to Each 5' but Im not sure how else to do it.
Not sure if there is a way to make mine work. Or maybe I should take a different approach....
Im still new at this.
3 answers
Sort by: Most helpful
-
Ryan P 6 Reputation points
2021-12-16T14:36:38.16+00:00 -
Ryan P 6 Reputation points
2021-12-15T22:08:22.833+00:00 I still dont know why it doesnt work but I have found another way to do it.
Instead of checking that 'Approvers' isnt empty, I copy 'Approvers' to an array. Then in my condition, I make sure the array isnt empty.
I also used 'length' instead of the 'empty' function.
Both of these differences were necessary. I dont why. If anyone knows, would be interested.
-
Elsie Lu_MSFT 9,761 Reputation points
2021-12-16T06:32:04.76+00:00 Hi @Ryan P , welcome to Q&A forum!
In fact we are currently providing help on SharePoint in the Q&A forum, and Power Automate is a product independent of SharePoint which we are not so familiar with. Regarding the difference between these two methods which is more related to Flow, we would recommend that you go to the forum dedicated to flow for more professional help:
Microsoft Power Automate Community
Thanks for your support and understanding.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.