Null values coming up and not being captured by if statement on virtual agent script

cchacha
Mega Guru

Hello people of servicenow,

 

I have a script in VA. I have somes values that come up null.

I am trying to put some kind of if statement "null" or null to take them out but it doesnt work.

Am I using too many '=''?

Should I just resort to using str.replace(/null/g, ""); or am I missing something here?

 

Thanks,

Carol

1 ACCEPTED SOLUTION

cchacha
Mega Guru

I managed to solve this I used (vaVars.thepromptsix!==null) , double equals sign was needed not just one.

View solution in original post

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@cchacha 

why not use JS util notNil() function?

JSUtil - Global 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur,

 

Thanks I have given it a try and it didnt work. Will try and look into other ways to get this working.

 

Carol

cchacha
Mega Guru

I managed to solve this I used (vaVars.thepromptsix!==null) , double equals sign was needed not just one.