Variable assignment - I have 4 variables but only one variable will always have value. I want a condition in type into activity which types only that variable which has value.
variable A , B , C , D are variable .
suppose C has only value so I want a one liner code which checks and type only value which is in C
Try using a For each activity that iterates through your variables and then have an If condition that checks if it has the value or not.
Let me know if this helps, Cheers!!
this is little complex but there is a way with which we can write just one line code and it uses only that variable which has value.
Hi @ravig1206 ,
Use the nested if statement to check if the variable has the value.
Eg:- if(not string.IsNullOrEmpty(a),a,if(not string.IsNullOrEmpty(b),b,next condition if any))
Try using what I said above and put in the if condition “CurrentItem <> null”
ahh This is what i was looking for thanks buddy
it is showing error ) expected
@ravig1206 , can you display the expression?
If(not String.IsNullOrEmpty(a),a,If(not String.IsNullOrEmpty(b),b,If(not String.IsNullOrEmpty(dates),dates)) this is the condition
@ravig1206 , you have missed out one bracket at the end and a default value if any of your variables does not have any value:
If(not String.IsNullOrEmpty(a),a,If(not String.IsNullOrEmpty(b),b,If(not String.IsNullOrEmpty(dates),dates,"")))
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.