Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - General Discussion
Unanswered

Convert Array number to Integer

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

lardo5150_0-1660226219070.png

 

So the last output is a single number, as you can see in the above.  It is an array.

I need to convert this to an integer, so I can run it through a condition and check if it is greater or equal than to 5.

How can I convert this to integer?

I tried a compose with int, but that gave me an error as you see.

  • Omika Profile Picture
    2 on at
    Re: Convert Array number to Integer

    Hi I am working on this flow and i am pulling data from power bi and i want to put condition when value is less than threshold then it should send me a mail. Here i am stuck at how to convert the data pulled from power bi to int.

    Can anyone help me with this?

    Omika_0-1715320533203.png

    Thanks

  • Chriddle Profile Picture
    7,932 Super User 2025 Season 1 on at
    Re: Convert Array number to Integer

    @Anonymous Since the values in your array are strings you have to convert them to Numbers before using them with max(). Use a Select action and functions isInt() and int() to convert them.

  • Community Power Platform Member Profile Picture
    on at
    Re: Convert Array number to Integer

    Hi lardo5150,

    Can you please explain how you solved the issue? It could be useful for me too, as I am after something very similar. Thank you!

  • Community Power Platform Member Profile Picture
    on at
    Re: Convert Array number to Integer

    Hi Chriddle,

    Thanks for this! I am after something similar, except that I would like to have the highest (not first) item of an array, and possibly also convert all empty values to zero. I tried to adapt your solution to my needs, changing the first function to 'max', but it did not work. This is the error message I got. Can you please help me to find out how can I get the highest value from my array?

    SalvadorBali_0-1683984012257.png

     

  • dixonbridgeta Profile Picture
    125 on at
    Re: Convert Array number to Integer

    No, I was just trying to get the integer from the array instead of the key and integer. But I looked on another form and found the solution by using an apply to each formula. 

    Thanks though!!

  • Chriddle Profile Picture
    7,932 Super User 2025 Season 1 on at
    Re: Convert Array number to Integer

    Did I get it right?

    You want the first element of an array and if the array is empty you want 0.

    coalesce(first(your_array), 0)

     

  • dixonbridgeta Profile Picture
    125 on at
    Re: Convert Array number to Integer

    @lardo5150 how did you get this to work?

  • Hardesh15 Profile Picture
    7,087 Super User 2024 Season 1 on at
    Re: Convert Array number to Integer

    @lardo5150  Use compose output in left side and Null expression in right side.

    Please 'Thumbs Up' the posts that helped you and 'Accept as Solution' if my post answered your question.

    @Hardesh /Gopenly.in

  • lardo5150 Profile Picture
    Microsoft Employee on at
    Re: Convert Array number to Integer

    empty in the condition does not work.

    Everthing is marked as true.

     

    lardo5150_0-1660231341482.png

     

  • Hardesh15 Profile Picture
    7,087 Super User 2024 Season 1 on at
    Re: Convert Array number to Integer

    @lardo5150  After Array use apply to each and pass array output. Then inside apply to each use compose and pass current loop item. Then use condition- Compose is not equal to Null then in Yes block use all actions which convert to int.

    Please 'Thumbs Up' the posts that helped you and 'Accept as Solution' if my post answered your question.

    @Hardesh /Gopenly.in

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1