Skip to main content
Community site session details

Community site session details

Session Id : YEDBSd1PavkghP/tukcVQk
Power Automate - General Discussion
Unanswered

Correct way to get the integer value of this...

Like (0) ShareShare
ReportReport
Posted on 31 Oct 2021 14:54:25 by 219

 

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.'.

  • sasrsc1966 Profile Picture
    219 on 01 Nov 2021 at 12:47:11
    Re: Correct way to get the integer value of this...
    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.

  • mahoneypat Profile Picture
    1,720 on 31 Oct 2021 at 18:24:03
    Re: Correct way to get the integer value of this...

    Please try this instead - with one parentheses moved

     

    int(first(body('Filter_array')?['Seats']))

     

    Pat

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

Loading complete