first(body('Filter_array'))?['Seats']
This return the seat value as "18" instead of 18.
How do I get the int value of this... this is being done in a compose...
I tried both of these but Power Automate didn't like either...
first(body('Filter_array'))?int(['Seats'])
int(first(body('Filter_array'))?['Seats'])
With the 1st one it says the expression is invalid and with the 2nd one and it accepts it but when I run it - it says ...
Unable to process template language expressions in action 'Compose_4' inputs at line '1' and column '25964': 'The template language function 'int' was invoked with a parameter that is not valid. The value cannot be converted to the target type.'.
int(first(body('Filter_array')?['Seats']))
I got this error...
Unable to process template language expressions in action 'SeatsTaken' inputs at line '1' and column '32112': 'The template language expression 'int(first(body('Filter_array')?['Seats']))' cannot be evaluated because property 'Seats' cannot be selected. Array elements can only be selected using an integer index. Please see https://aka.ms/logicexpressions for usage details.'.
My workaround is to create a compose action step called SeatsTaken.
first(body('Filter_array'))?['Seats']
Then in my next step do...
int(outputs('SeatsTaken'))
It's a double step but works.
Please try this instead - with one parentheses moved
int(first(body('Filter_array')?['Seats']))
Pat
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