cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
xavirb
Level: Power Up

flow mathematical functions

Hi,
I'm learning a little bit of flow, and I can't multiply a couple of data entered by the user.
I enter the data as a number, and use the mul('number','number_1') function but it returns an error indicating:

the template language function 'mul' expects its first parameter to be an integer or a decimal numbre. The provided value is of type 'String'

can you help me?

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: flow mathematical functions

 

Hi @xavirb ,

 

Perhaps you can try to use the float() function to convert string-type data to number. Like:

mul(triggerBody()['number'],triggerBody()['number_1'])

It's also worth noting that although you enter two numbers in the inputs, if they are not used for any calculations, they will be presented as strings instead of another number that is spliced into two numbers.

80.PNG

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
xavirb
Level: Power Up

Re: flow mathematical functions

the code don`t run:

 

{
"inputs": "@{triggerBody()['number']}@{triggerBody()['number_1']}"
}
{
"inputs": {
"host": {
"connection": {
"name": "@json(decodeBase64(triggerOutputs().headers['X-MS-APIM-Tokens']))['$connections']['shared_sharepointonline']['connectionId']"
}
},
"method": "post",
"body": {
"Title": "@base64ToString(triggerOutputs()['headers']['x-ms-user-email-encoded'])",
"ImportesinIVA": "@mul('number','number_1')"
},
"authentication": {
"type": "Raw",
"value": "@json(decodeBase64(triggerOutputs().headers['X-MS-APIM-Tokens']))['$ConnectionKey']"
}
}
}

 

 

Dual Super User
Dual Super User

Re: flow mathematical functions

Hey @xavirb 

 

Maybe you are providing the input as string (text) and the issue is coming due to that. You can convert the input to int and then use the mul function to multiply. The int() function can be used to convert the numbers entered as a string to a number format. Your expression would now look something like: 

 

mul(int('number'),int('number_1'))

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Community Support Team
Community Support Team

Re: flow mathematical functions

 

Hi @xavirb ,

 

Perhaps you can try to use the float() function to convert string-type data to number. Like:

mul(triggerBody()['number'],triggerBody()['number_1'])

It's also worth noting that although you enter two numbers in the inputs, if they are not used for any calculations, they will be presented as strings instead of another number that is spliced into two numbers.

80.PNG

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,425)