web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Unable to convert para...
Power Automate
Unanswered

Unable to convert parameter from forms to integer for condition

(0) ShareShare
ReportReport
Posted on by 16

Hi, recently picked up power automate and I'm having an issue with converted a parameter to an integer. This is the error message:

Unable to process template language expressions in action 'Send_an_email_(V2)_3' inputs at line '0' and column '0': 'The template language function 'int' was invoked with a parameter that is not valid. The value cannot be converted to the target type.'.

 

Respondents indicate either 1,2,3 or 4 in the forms. If it's 1, an email is sent. If it's not 1 (2,3,4), another email is sent. This is my expression to convert the response to an integer for the condition: 

 

int(outputs('Get_response_details')?['body/r0fcb009ec0854526863a901664ae6847'])

 

Help would be sincerely appreciated! 

 

Flow

Kai_1-1671293987994.png

 

Error message

Kai_0-1671293908945.png

 

Categories:
I have the same question (0)
  • Amit_Sharma Profile Picture
    1,569 Super User 2024 Season 1 on at

    Hi @Kai-- 

    Could You Show Me Output of Only This Expression.

    outputs('Get_response_details')?['body/r0fcb009ec0854526863a901664ae6847'])
  • Amit_Sharma Profile Picture
    1,569 Super User 2024 Season 1 on at

    Hi @Kai-- 

    Could You Show Me Output of Only This Expression.

    outputs('Get_response_details')?['body/r0fcb009ec0854526863a901664ae6847'])
  • Amit_Sharma Profile Picture
    1,569 Super User 2024 Season 1 on at

    Hi @Kai-- 

     

    I think there Is return Value Which is not Decimal value that's why It's create error.

     

    Could you try With This Expression

     

    int(first(string(outputs('Get_response_details')?['body/r0fcb009ec0854526863a901664ae6847'])))

     

     

     

    -------------------------------------------------------------------------

    Did I answer your question? Please Mark my post as a solution
    If you liked my response, please consider giving it a thumb up

     

  • grantjenkins Profile Picture
    11,063 Moderator on at

    It looks like the condition itself is fine. It's whatever you have within your Send an email (V2) action that's causing the issue. Can you check your int expression within your Send an email to ensure you're using the correct field.

  • Kai-- Profile Picture
    16 on at

    Hey @Amit_Sharma thanks for your help, really appreciate it

     

    1) Here's the output from the form for "outputs('Get_response_details')?['body/r0fcb009ec0854526863a901664ae6847'])". It's a choice question, choose 1-4. Is this what you are looking for regarding "output of only this expression"?

    Kai_0-1671420508588.png

     

    2) I tried int(first(string(outputs('Get_response_details')?['body/r0fcb009ec0854526863a901664ae6847']))) but still got the same error message  

     

    Unable to process template language expressions in action 'Send_an_email_(V2)_3' inputs at line '0' and column '0': 'The template language function 'int' was invoked with a parameter that is not valid. The value cannot be converted to the target type.'.

     

    I'm not sure why the parameter is invalid

  • Kai-- Profile Picture
    16 on at

    Hey @grantjenkins thanks for helping.

     

    Send an email (V2)2 works fine but not send an email (V2)3. I can't figure out why the int expression isn't working either

  • grantjenkins Profile Picture
    11,063 Moderator on at

    @Kai-- Can you add a Compose within your No branch, just before your Send an email (V2) 3 action and add your choice field so you can see exactly what the raw output is.

     

    outputs('Get_response_details')?['body/r0fcb009ec0854526863a901664ae6847'])

     

    Also, is that field a required field in your Microsoft Form?

     

  • Kai-- Profile Picture
    16 on at

    @grantjenkins Is this what you need?

     

    Kai_0-1671421949718.png


    Yes it is a compulsory field, it has branching logic depending on whether 1 or 2-4 is chosen

  • grantjenkins Profile Picture
    11,063 Moderator on at

    Couple more questions.

    1. On the Compose you just added, can you click on Show raw outputs to see if the number is enclosed within double quotes "4", or just a number 4
    2. Are you able to show your expression you've used within your Send an email (V2) 3 action?
  • Kai-- Profile Picture
    16 on at

    1. Double quotes "4"

    Kai_0-1671422455739.png

    2. 

    Not sure if this is what you're looking for, but the expression I'm using for the condition

    - outputs('Get_response_details')?['body/r0fcb009ec0854526863a901664ae6847'])

    OR (recommended by Amit)

    - int(first(string(outputs('Get_response_details')?['body/r0fcb009ec0854526863a901664ae6847'])))

     

     

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard