cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DCNehs
Post Patron
Post Patron

odata filter - scheduled workflow

I have set the ODATA filter as IssueStatus eq 'DTC to Verify' which works fine to send them a list of all of issues that need to be reviewed.

 

The problem I'm running into is that even when there aren't any issues set with the status of DTC to Verify, it's still sending an email but an empty list which is a bit goofy.  I only want an email to be sent if there are issues.

 

Is there a way to get it to NOT run if there aren't any under that status? I tried adding the Trigger below, but when trying to test (using manual) it errors and comes up with Cannot read property 'properties' of undefined. Or Maybe this is ok and it's supposed to do that?

@equals(triggerBody()?['IssueStatus']?['Value'],'DTC to Verify')

1 ACCEPTED SOLUTION

Accepted Solutions
tom_riha
Super User
Super User

Hello @DCNehs ,

scheduled flows are not connected to any item/file, therefore, you can't use any list/library property in the trigger condition. But you can check if the 'Get items' found any items that fit the filter, and send the email only if it did.

Add a 'Condition' after the 'Get items' that will check if the length(...) of the 'value' output is greater than 0 (an item was found). If it's greater, process the data and send an email. If it's not, do nothing.

image.png

 



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

View solution in original post

2 REPLIES 2
tom_riha
Super User
Super User

Hello @DCNehs ,

scheduled flows are not connected to any item/file, therefore, you can't use any list/library property in the trigger condition. But you can check if the 'Get items' found any items that fit the filter, and send the email only if it did.

Add a 'Condition' after the 'Get items' that will check if the length(...) of the 'value' output is greater than 0 (an item was found). If it's greater, process the data and send an email. If it's not, do nothing.

image.png

 



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

View solution in original post

Ahhh, that would make sense with the trigger.  This did the trick very neat for someone still learning.  Probably not so much for you 🙂

 

Thanks so much!  This will definitely come in handy and now i have a bit better understanding about length.

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!

Top Solution Authors
Top Kudoed Authors
Users online (2,839)