cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tre4B Advocate IV
Advocate IV

Is there an Exists for single item from a list access

 

I have a sharepoint list that contains unique records.  I want in a single flow to select and work with that one record.

 

Get Items, and Data Operations filter Array both return lists and all I want to do is verify the item is contained in the list so that I know if it needs to be created or not.

 

Get Items:  I cannot get the filter to work.  If I use outlandish basic queries though (i.e.  1 Eq 2 or something) I can get it to give me a list or a null value.  I can then test for the list Value being null and I'm away.

 

Filter Array:  This does the filtering correctly but returns a body whether or not it finds anything so I can't test for null.  Both Body and Table item entity need to be itterated to figure out if the body is valid or not.

 

Is there an easy way to do what in csharp would be  nnnnnn.Exists("xxxxx") in a condition?

1 REPLY 1
Community Support
Community Support

Re: Is there an Exists for single item from a list access

Hi @tre4B,

 

Could you please share a screenshot of your flow's configuration?

Could you please show a bit more about your SharePoint list?

Do you want to check if the item is contained in the list?

 

If you want to check if the item is contained in the list, please take a try with the following workaround:

  • Using "OData Query" within Filter Query field of "Get items" action to achieve your needs:25.JPG

     Within "Filter Query" field of "Get items" action, type the following formula:

Title eq 'Test1'

Note: The Title represents a unique column in your SharePoint list, The Test1 represents the value.

 

 

Within Condition box, type the following formula:

@empty(body('Get_items')?['value'])

If the result the Condition box evaluated is true, it means that the item is not contained in the list, you need to create. Otherwise, do nothing.

 

 

  • Using "Filter array" action to achieve your needs:26.JPG

    Within "Filter array" action, From set to output of "Get items" action, click "Edit in advanced mode", type the following formula:

    @equals(item()?['Title'], 'Test1')

    Note: The Title represents a unique column in your SharePoint list, The Test1 represents the value.

        Within "Condition" box, click "Edit in advanced mode", type the following formula:

@empty(body('Filter_array'))

If the result the Condition box evaluated is true, it means that the item is not contained in the list, you need to create. Otherwise, do nothing.

 

 

Best regards,

Kris

 

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (8,284)