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.
Any ideas on how to mitigate?
Thanks!
Solved! Go to Solution.
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'))
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!
Hi @iivanov,
Since the variable only support integer, you can convert it into a string by using the String() function.
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.
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'))
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!
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!
Power Automate User Groups are coming! Make sure you’re among the first to know when user groups go live for public preview.
User | Count |
---|---|
48 | |
11 | |
10 | |
10 | |
7 |
User | Count |
---|---|
75 | |
22 | |
14 | |
11 | |
11 |