Solved

O365 String comparison


Badge +5

Hello,

I have a field on a list and I need to do a string comparison so that I can choose between two branches of a condition.  How can I accomplish this?   In the attached screenshot you will see that I have tried to configure a Regular Expression but it is not working (either with or without quotes).  I have also tried the action Find Substring in String but that does not seem to work either.

 

Any help would be appreciated.

 

Thank you,

Matt

icon

Best answer by olampl11 29 June 2016, 16:41

View original

10 replies

Badge +5

Oh - I have also tried this within the condition statement but that doesnt work either - see the attached screenshot.

if state.JPG

Badge +8

Hello Matthew,

have you tried to print out the value of the field "Adjustment Type" by using the action "Log to History" action.

Maybe it is a Lookup Value, if so it is clear why your expression won't work. (Because in that case the value has an prefix.)

Have you tried to use the "contains (ignoring case)" comparison?

Regards

Oliver

Badge +5

Hello,

Thank you for your reply.  When I log the list item is have the following: CurrentAdjustementType = "Sick Leave Request".  I tried this in a Conditional statement but the result is the same - it does not find the text and always chooses the No branch.  Any other thoughts on how I can accomplish this string comparison?  Is it the space that is causing the issue?  Do I need to read it into a variable first?

I very much appreciate your thoughts on the matter.

cond.JPG

Badge +8

Hello Matthew, now I think I understood.

The column "Adjustment Type" holds only one value either "Vacation Request" OR Sick Leave Request, but not both at runtime (That means it if you use the AND).

Just give it a try and choose the OR binding instead of the and, than it should choose the yes branch for those two values.

Regards

Oliver

Badge +9

Hi Matthew,

What is the column type for Adjustment Type? I'm trying to replicate this issue in my build, but I'm not sure if you are using a drop down (choice) column or Single Line text?

Thank you,

Sean

Badge +5

Hello Sean,

The column is a choice column.  Below is a list of all the columns in the list and further down is the details of the column.  Thank you for taking a look.

column_types.JPG

~~~~~~~~~~~~~~~~Leave Type Column.JPG

Thanks!

Matt

Badge +9

Hi Matthew,

Man that's awesome! Thanks for sending those screenshots.

So I ran a quick test of a drop down column with the following settings:

From there, I added a workflow that has the following condition and logs a value for either branch:

Log to History if 'Yes':

Log to History if 'No':

When I run the workflow using 'Vacation Request' as the drop down choice, I am provided with the correct response.

Do you experience the same issue when you only use one condition within the 'Set Condition' action or does it happen regardless of the number of conditions?

Badge +5

Hello Sean,

I just tried it again and it works with both conditions.  I think the first time I was trying it with a Run If that was imported by ShareGate from our on-prem environment.  When I recreated it with a Conditional Statement Oliver was correct in that I had AND rather than OR.  I am not sure if Run If and Conditional evaluate strings differently or if something about the migration didnt come over correctly.

Thank you for taking your time to look into this,

Matt

Badge +5

Well look at that - you are correct - recreating it as a Conditional instead of a Run If and selecting the correct option (OR) worked.  Thank you very much Oliver.

Badge +8

My pleasure.

Nice to here that I was able to help you,

Happy nintexing

Regards

Oliver

Reply