cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
iivanov Helper I
Helper I

IF statement for floats and Azure DevOps (ADO)

Hello,

 

I am trying to use Flow to add multiple numbers (floats) together and I need to use an IF statement on every field I want to add together because not all the values are required in Azure DevOps.

 

Here's an example IF statement:

if(empty(body('Get_work_item_details')?['fields']?['Custom_SpInFormsIncorrect']), 0, body('Get_work_item_details')?['fields']?['Custom_SpInFormsIncorrect'])

Unfortunately, the IF statement/empty() function in Flow will only work with integers, strings, and arrays.

Flow floats.PNG

 

Any ideas on how to mitigate?

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: IF statement for floats and Azure DevOps (ADO)

Hey @iivanov 

 

You can use the string function to convert the body (the float value to a string and compare and then update the variable accordingly)

 

Expression:

if(empty(string(variables('e'))),0,variables('e'))

f11.PNG

 

f111.PNG

 

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!

 

 

View solution in original post

3 REPLIES 3
Community Support
Community Support

Re: IF statement for floats and Azure DevOps (ADO)

Hi @iivanov,

 

Since the variable only support integer, you can convert it into a string by using the String() function.Annotation 2019-10-22 154746.png

 

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

Dual Super User
Dual Super User

Re: IF statement for floats and Azure DevOps (ADO)

Hey @iivanov 

 

You can use the string function to convert the body (the float value to a string and compare and then update the variable accordingly)

 

Expression:

if(empty(string(variables('e'))),0,variables('e'))

f11.PNG

 

f111.PNG

 

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!

 

 

View solution in original post

Dual Super User
Dual Super User

Re: IF statement for floats and Azure DevOps (ADO)

Hey @iivanov 

 

Were you able to resolve? If this issue is resolved, please mark the response that helped you as 'Accept as Solution'. 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!

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

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!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,768)