# Workflow : Compare string Operator - Contains

**URL:** <https://developer.sailpoint.com/discuss/t/workflow-compare-string-operator-contains/7659>\
**Category:** SHF Discussion and Questions\
**Tags:** workflows\
**Created:** [January 23, 2023, 4:13am UTC](https://developer.sailpoint.com/discuss/t/workflow-compare-string-operator-contains/7659 "2023-01-23T04:13:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![IAMpdu](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/iampdu/32/2671_2.png) [@IAMpdu](https://developer.sailpoint.com/discuss/u/IAMpdu)\
**Post date:** [January 23, 2023, 4:13am UTC](https://developer.sailpoint.com/discuss/t/workflow-compare-string-operator-contains/7659/1 "2023-01-23T04:13:02Z")

</div>

Hello Team,

I am using workflow action as “ **Get Account** ” and the get account is returning the accounts related to specific identity after that I am validating that the user having " **demo**" account or not, to validate that I am using “ **Compare String Operator Contains method** ” (Below are the values for compare string)

Value 1 = $.getAccount.accounts[\*].sourceName - [“demo”,“demo1”,“demo2”]

operator = contains

Value2 demo

but the condition **always goes to false even** if the array contains “demo”.

@colin_mckibben can you suggest anything?

Thanks,  
Prasad

---

<div class="post-metadata">

**Author:** ![colin\_mckibben](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/colin_mckibben/32/37182_2.png) [@colin\_mckibben](https://developer.sailpoint.com/discuss/u/colin_mckibben)\
**Post date:** [January 25, 2023, 3:49pm UTC](https://developer.sailpoint.com/discuss/t/workflow-compare-string-operator-contains/7659/2 "2023-01-25T15:49:48Z")

</div>

Hi Prasad,

The “Compare String” operator is for comparing two string values. In your example you are attempting to compare a list with a string, which is why you are always getting false. In this case, you won’t be able to use “Compare Strings” to achieve your goal. Instead, try using the “Verify Data Type” operator with a slightly different JSONpath filter, as shown in the following image.

 ![image](https://global.discourse-cdn.com/sailpoint/original/2X/6/6b47ea998811d682d3c41588a7aff86733aa1e96.png)

This will work as long as you are trying to match an account that has the exact name “demo”. For example, if your account list is [“demo”,“demo1”,“active directory”], it will return true. If your account list is [“demo1”,“active directory”], it will return false because there is no account with the exact name “demo”.

---

<div class="post-metadata">

**Author:** ![tranetechnologies](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/tranetechnologies/32/1062_2.png) [@tranetechnologies](https://developer.sailpoint.com/discuss/u/tranetechnologies)\
**Post date:** [March 7, 2023, 2:07pm UTC](https://developer.sailpoint.com/discuss/t/workflow-compare-string-operator-contains/7659/3 "2023-03-07T14:07:06Z")

</div>

Thanks for posting this, exactly what we also were looking for!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [July 19, 2023, 2:24pm UTC](https://developer.sailpoint.com/discuss/t/workflow-compare-string-operator-contains/7659/4 "2023-07-19T14:24:08Z")

</div>


