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.
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?
Thanks
@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.
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!
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?
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!!
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)
@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.
empty in the condition does not work.
Everthing is marked as true.
@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.
Michael E. Gernaey
497
Super User 2025 Season 1
David_MA
436
Super User 2025 Season 1
Riyaz_riz11
244
Super User 2025 Season 1