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 / flow mathematical func...
Power Automate
Answered

flow mathematical functions

(0) ShareShare
ReportReport
Posted on by 5

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!

Categories:
I have the same question (0)
  • xavirb Profile Picture
    5 on at

    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']"
    }
    }
    }

     

     

  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    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!

  • Verified answer
    v-bacao-msft Profile Picture
    on at

     

    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,

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 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard