cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
rsanford
Level: Powered On

Using variables

One of my variables is set to take a numerical amount from a Microsoft Form and multiply it by a specific amount.  However, there is a previous question on the form that branches past this question if it does not apply.  If this question is not answered, the flow fails because there is no value to input.  Is there a way to create an action where if the answer is blank, it will input 0 or tell the variable not calculate?

 

variable.png

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Using variables

Hi @rsanford,

 

In my screenshot, I choose the Output dynamic content of the Compose in the Value field to set the variable.

 

Best regards,

Alice

View solution in original post

5 REPLIES 5
Community Support Team
Community Support Team

Re: Using variables

Hi @rsanford,

 

Could you please share a full screenshot of the configuration of your flow?

 

You could add a Condition to check if the value is null, if the value is null, set the variable to 0,if no, set the variable with the value.

 

I have made a test on my side to create the flow as below:

Capture.PNG

 

 

I have save the question 1 answer in the Compose, and check if the compose is null.

The expression in the Condition as below:

@empty(outputs('Compose'))

When a response is submited,and the question is no answer, the flow would run successfully as below:

Capture.PNG

 

 

Please let me know if your problem could be solved.

 

 

Best regards,

Alice

 

rsanford
Level: Powered On

Re: Using variables

Thanks.  I am still having trouble.  See flow below.  The variable I am working on is the "mileage cost."

 

 

step 1.JPGstep 2.JPG

 

step 3.JPG

Community Support Team
Community Support Team

Re: Using variables

Hi @rsanford,

 

In my screenshot, I choose the Output dynamic content of the Compose in the Value field to set the variable.

 

Best regards,

Alice

View solution in original post

Administrator
Administrator

Re: Using variables

 Hello, @rsanford!

 

Have you had an opportunity to apply @v-yuazh-msft‘s recommendation to adapt your Flow? If yes, and you find that solution to be satisfactory, please go ahead and click “Accept as Solution” so that this thread will be marked for other users to easily identify!

 

 

Thank you for being an active member of the Flow Community!

 

-Gabriel

Flow Community Manager

-Gabriel
Microsoft Power Automate Community Manager
Are YOU a member of your local Power Automate User Group?
Fill out This Form to claim your Community User Group Member Badge!
rsanford
Level: Powered On

Re: Using variables

Thank you for the help!  I think I got that part to work.  However, it is still failing at the next step when I am trying to multiply the variable by 1.75.  I am using the following code:  

mul(float(body('Get_response_details')?['r186108bf159f4ca7a0f156601dc48f4e']),1.75)
 
pic2.JPG

 

pic1.JPG

 

Here is the error message I get:

 

pic3.JPG

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Speakers, submit your sessions now! Call for speakers ends Feb. 10!

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 Kudoed Authors (Last 30 Days)
Users online (4,509)