Checking null value in workflow for Compare String

I’ve been trying to verify a null value in my workflow using a compare string to no avail. The issue is that I am trying to compare an attribute change for “jobCode” , to check if the old value in value 1 is not equal to ‘null’ (meaning no value existed before), a certification campaign should be kicked off else end process. This is to help worker transition from NELM to HR workers. Only HR workers have jobCode, so when that transition happens the worker will now get a jobCode (example jobCode none → 1212) and the workflow sees it as an attribute change for jobCode and creates a certification but technically it’s not a change, hence why I want to check the old value for jobCode if it goes from none to a value, no certification should be generated. Certification will only be generated when jobCode changes from one value to another (example jobCode 1212 → 3456). See images for visuals of what I am trying.

image 1

image 2

@adunker @colin_mckibben any thoughts on this? your help would be much appreciated

Hi @dcoleman ,

Have you considered using the Verify Data Type operator instead?

This step can validate whether the value in the selected attribute:

  • Exists

  • Is a boolean

  • Is a number

  • Is a string

  • Is a timestamp

  • Is null

Thank you,

  • Zach

Hi @zachm117 , I thought about that but I’m not sure what to put in the value field to check the attribute change for the jobCode old value to evaluate it.

Try the value you were using previously and use either the ‘Is Null’ or ‘Exists’ Data Type.

So far it’s not working with the old value line of code I had before when I use verify data type instead of compare string. When I use this $.loop.loopInput.jobCode in value 1 and select is null, it works only one way but not the other way, and I dont want that. I want to ensure the workflow does what it should as well if false as well. I’m exploring some more with it.

Ok I found a work around and it’s now working. In order to get the old value for “jobCode” evaluated after the trigger change. I first did a compare string to check the trigger change in the loop if its equal to “jobCode”, then use another compare string operator once that is true to evaluate the oldValue in Value 1 and check value 2 if that is null (I leave value 2 empty for the null value), it will end the step in this case, otherwise it will send the certification etc. see images below for visual. When I used the Data Type Operator, it was only giving me results if the argument is true and that was not what I wanted.

In summary the aim is to not generate a certification when “jobCode” oldValue is null but generate one if it is not null

Compare String 8

Compare String 9

1 Like