Hi, I would like to know how can I assign a boolean value to a string that contains specific texts?
Specifically, I want it to be like this:
when the string contains “Yes” return a boolean value of True
when the string contains “No” return a boolean value of False.
Sorry if this sound too easy I am quite new to UiPath automation, I just hope to get some assistance on this
- Use If condition
If the String is Yes it will Go to Then part
If the String is No it will Go to Else part
if you want to have it concise, you can use inline if in Assign activity. If YourString will be “Yes”, then it will assign True to YourBool, if YourString will be anything else, it will assign False.
Please use assign activity
on left side put bool variable
right side put string operation like this
Hello @Ben_siu , Try this
YourString=“The Answer is Yes”
it will return as “True”, If there is no "Yes in your string, it will returns “False”
Try inline if condition like below-
if(mystring.contains(“Yes”), “TRUE”, if(mystring.contains(“No”),“FALSE”,‘’ "))
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.