I have a flow that sends an e-mail once a form response has been approved and it works fine for what we need it for (I'm not very good with Power Automate but I've tinkered around and figured out some basics). However, I now need to add a line that multiplies one of the responses by a percentage and provides the result in the e-mail that automatically goes out once the response is approved.
I'm wanting the "Total Invoice Amount" dynamic content to by multiplied by 15% to spit out a fee in the highlighted area. I've tried using mul() and everything I try says "Expression is invalid." Any help is appreciated.
Thank you
Solved! Go to Solution.
Try adding a zero in front of the decimal. Here's mine:
mul(float(body('Get_response_details')?['rad28bd42b51143a9bc3c7505da370bf7']),0.15)
That worked. But when I take the zero out, I get an error. I get it, I guess. Maybe it needs to know there's a number there and not some weird syntax.
-Ed
If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.
Hey there. What does the expression look like, as a whole? The field coming from the Form, is it formatted as a number? You may need to do something like: mul(float(<formoutput>),0.15)
Keep us posted. Good luck!
-Ed
If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.
I'm not sure how to answer that, sorry. This is what it looks like when I try to enter the expression, then choose the "Total Invoice Amount" dynamic content, and I'm getting the "expression is invalid" message when I try to save it:
No worries, let's try this first and see what happens:
mul(float(body('Get_response_details')?['rdb4f988cc9b546d9bb1b3f18ef562ae9']),.15)
I'm working under the assumption that Forms is probably sending a text field over and we'll need to convert it. If we can change the format on the Form itself to a number, that would help.
There's also a chance it's sending stuff like a dollar sign and weird things like that. If you click on the flow name from the "My flows" screen, you'll see past runs (they probably will have a "failed" or something next to them). If you click on one of those runs, you'll see the error, but then you can also go up a step or two to see what kind of data the Form is sending.
Keep at it.
-Ed
Ed-
I tried that expression but it still won't let me save ("expression is invalid"). On the Form itself I do have this field set up as a number format.
Try adding a zero in front of the decimal. Here's mine:
mul(float(body('Get_response_details')?['rad28bd42b51143a9bc3c7505da370bf7']),0.15)
That worked. But when I take the zero out, I get an error. I get it, I guess. Maybe it needs to know there's a number there and not some weird syntax.
-Ed
If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.
I gave that a shot this morning and it did let me enter the expression and save the flow at least, but the flow itself is still failing at the Send an Email step:
InvalidTemplate. Unable to process template language expressions in action 'Send_an_email_(V2)' inputs at line '1' and column '2136': 'The template language function 'float' was invoked with a parameter that is not valid. The value cannot be converted to the target type.'.
Ed - I think I've got it figured out now. I used your suggestion of "0.15" instead of .15, but also including converting the dynamic content into an integer and it works perfectly:
That's great! I'll have to read more about int() as I always thought it turns things into whole numbers. I'm glad to hear it doesn't, though, that makes things way easier.
Awesome job!
Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!
Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.
User | Count |
---|---|
88 | |
58 | |
42 | |
37 | |
36 |
User | Count |
---|---|
86 | |
72 | |
61 | |
58 | |
40 |