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 / Correct way to get the...
Power Automate
Unanswered

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

(0) ShareShare
ReportReport
Posted on 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.'.

Categories:
  • mahoneypat Profile Picture
    1,720 on at

    Please try this instead - with one parentheses moved

     

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

     

    Pat

  • sasrsc1966 Profile Picture
    219 on at
    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.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 424

#2
11manish Profile Picture

11manish 328 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 274

Last 30 days Overall leaderboard