Power Automate if get items is empty

Loading

Requirement:  Power Automate if get items are empty.

Take a SharePoint List as “Product List”

Power automate if get items are empty

In Power Automate,Create an Instant Flow, Provide a name to the flow, select the Manually triggered Flow, click on the Create button, then click on the Next step.

How Power automate if get items is empty

Select Get items action, then provide the site address, list name, and in the Filter query write the below query:

Rating gt '4'

How Power automate if get items is empty

Then initialize two variables of string type, so click on the Next step and select Initialize variable action. Then provide a variable name, and type it as a string.

Microsoft Flow if get items is empty

Next, check the length of the value property of getting items, and the length could be 0 or more.

So click on the next step and select Condition control, then provide:

  • value: length(body(‘Get_items’)?[‘Value’])
  • operator: is greater than
  • value: 0

Next the yes condition, so click on add an action, and select Set variable action. Then select the variable name ‘isNotEmpty’ and then set the value as false. Then in If condition, select set variable action and select the variable name as ‘isEmpty’ and in value add an expression as true

How Microsoft Flow if get items is empty

Now click on save and run the flow manually. In this example, there are no items are in the list that has ratings greater than 4, so get items output value is null. So the condition is false it will run if no part.

MS Flow if get items are empty

Leave a Reply

Your email address will not be published. Required fields are marked *