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 array values and...
Power Automate
Unanswered

Check array values and return the index of specific value

(0) ShareShare
ReportReport
Posted on by 36

Hi, 

Can anyone please help me with this? 

 

I'm trying to check an array in Power Automate whether it has a number or not, and return its index. The array is received from powerapps as a string and the number of elements is not fixed, but it could have one numeric value. 

 

some examples of the arrays the flow might receive from powerspps

["","","200",""]

["","",""]

["","400",""].

 

 

The flow I need to make should check first if the array has a numeric value or not, and if it does, the flow should return its index and a variable. 

 

any thoughts? 

 

Categories:
I have the same question (0)
  • Matthy79 Profile Picture
    4,188 Super User 2024 Season 1 on at

    Hello @OmarSaleh 

     

    This is what the flow could look like:

     

    Matthy79_1-1703359513778.png

     

    1. Use json function to transform your parameter into an array.
    2. Use select to create your index. index = item() and value = 
      outputs('Compose_string_array')[item()]
    3. Use filter array to only get those elements that has a numeric value
    4. Respond to your app using this formulas:
      if(empty(body('Filter_index')), false, true)
      coalesce(first(body('Filter_index'))?['value'], -1)

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 592

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard