I want to check (in a loop) if a number field is empty or not. Can I achieve this with greater than/less then etc.?
I want to go into the loop in case the field is empty.
I tried (as a workaround) to save my number fields as text variables in my workflow and check if they are empty ('is empty' and 'is not empty' are not available in the number settings).
The problem is that the workflow does not enter the loop so it does not notice that the text variables are empty.
Solved! Go to Solution.
Hi thzu thzu
In the workflow, create a single line text variable which will allow for blank and then convert the text variable to numeric using Convert Value action. Then compare your field against this variable. You could also put some validation to make sure numeric values are entered. Hope that helps.
I'm having the same problem but with this solution I get an error in the Convert Value action:
Error parsing value. Value '' is not compatible with the selected output variable type List Item ID (integer).
Am I doing it right?
Hi Jaume Ribas
If you are trying to compare if the ID is empty, then this would not work. ID is an integer and not a number.
You would be able to compare ID as empty straight in the comparison, have you tried that? I don't have On-prem environment so i can't test the exact situation. Let us know.
Hi Kapil Joshi
The list field I'm trying to compare is a Number field, but the variable I was using was type Integer, I guess that explains the "List Item ID (integer)" in the error. I did another test with a Number variable and the error is this other one:
Error parsing value. Value '' is not compatible with the selected output variable type Number (double).
I ended up storing the field in a Single line of text variable and to my surprise the value for empty is "0". This is fine for my case, but could be problematic if 0 was a possible valid value. I did a test with a Set a condition action comparing the field value directly with the value 0 and for an empty value the action says they're equal.