web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Check if an item exist...
Power Automate
Answered

Check if an item exists in array

(2) ShareShare
ReportReport
Posted on by 12

Hi I am trying to Build a flow, in part of the flow I need to check if an item exists in an array. Is it possible to do this?

my only problem is to check if exist in the array

the following shows my workflow:

2019-03-12_12-18-09.png

 

 

Categories:
I have the same question (0)
  • Verified answer
    v-yamao-msft Profile Picture
    Microsoft Employee on at

    Hi @EhsanAliverdi ,

     

    To check if an item exists in an array, please check the following flow for a reference.

     

    In my scenario, I am going to check if a button input exists in an array. If Yes, do nothing. If no, add the item to the list.

    1.PNG2.PNG

     

    Best regards,

    Mabel

     

  • mboonie Profile Picture
    164 on at

    Hi. I have a question  about what might be the most efficient way to check whether a value exists in an array. Two straighforward approaches, it seems are these:

    • Loop through the collection and check each element, either setting a flag (e.g. blnValueFound = true), or concatenate the values and check the string (as above).
    • Apply a filter to the collection and then check whether it's empty.

    Does anyone know which is the best approach in terms of speed and resources?

     

    Thanks.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I use a Compose where I store my triggerbody() array. In my example, I get one or more IDs by the triggerbody() separated by a comma. Then, to avoid the error, I check if it's empty. If so, I store an empty Array('') in my Compose; otherwise, I store the triggerbody() response. After that, I'll continue my flow with the array empty or not.

     

    2021-08-30_20-15-40.png 

     

    For what it's worth

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 523

#2
Valantis Profile Picture

Valantis 318

#3
David_MA Profile Picture

David_MA 235 Super User 2026 Season 1

Last 30 days Overall leaderboard