glennd
Rookie

Compare fails for string with double-quote

I'm using a rule to compare two strings and format the control (turn red) if they are different. Everything works great unless I encounter a string containing a double-quote. The fields are descriptions and often contain measurements, such as Length is 11". The rule is simply DescOriginalValue == DescNewValue.

The rule works as expected when the form is in edit mode, but when in View mode, the result is false. I think the rule is getting tripped up on the double-quote, but why does it work when the form is in Edit mode

 

0 Kudos
Reply
4 Replies
MegaJerk
Collaborator

Re: Compare fails for string with double-quote

Can you provide to use the values of the previous description string and the new description string? 

 

That way we can compare what you're comparing to better help figure out a solution.

0 Kudos
Reply
glennd
Rookie

Re: Compare fails for string with double-quote

The text can be anything containing a " (double quote). Such as: Length is 11"
If the DescOriginalValue and DescNewValue have exactly the same string containing a double quote, the rule shows true when the form is in edit mode, but in view mode, the rule evaluates to false.

0 Kudos
Reply
MegaJerk
Collaborator

Re: Compare fails for string with double-quote

and how are these values being set exactly? you have a "previous" value. Is it set in a workflow after the form has been submitted or by some other means?

 

The more details the better

 

 

0 Kudos
Reply
glennd
Rookie

Re: Compare fails for string with double-quote

This is a Nintex Form on a SharePoint 2019 list. The DescOriginalValue field is a Single Line of Text field on the SharePoint list. The rule is on the form control, it is a Formatting rule, the condition is:

not(equals({Self},DescNewValue)))

It colors the control orange if it evaluates to true (meaning the two values are not equal).

DescNewValue is a Calculated Value control on the form, populated by a lookup function, pulling the value from another SharePoint list, Single Line of Text field.

This control is set to calculate on form modes View and Edit.

 

I think the issue is in the value returned by the Lookup function, when the value contains a double-quote character. The value being pulled from the other SharePoint list is exactly the same as DescNewValue - I have verified many times. You can click "Edit item" on the SharePoint list item, and in edit mode, you can see that the two values are exactly the same, and the rule evaluates correctly, and the control is not shaded orange.  However, click "View Item", you see the two values exactly the same, but the rule evaluates to true, and the control is shaded orange.

0 Kudos
Reply