cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tre4B
Level: Powered On

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 Team
Community Support Team

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
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 448 members 4,814 guests
Please welcome our newest community members: