Hello, is there a way to check if search.lookupFields is returning a null value?
m
mdr
12/02/2021, 11:38 PM
Set return value to a variable. Then null check the variable (ex: if(lookupVar === null) //do something...)
k
kwood
12/02/2021, 11:38 PM
Actually null or just empty string, there is a difference.
kwood
12/02/2021, 11:40 PM
Also check the length of the array because it will throw an error if you try the field when the result is empty
kwood
12/02/2021, 11:41 PM
I find it helpful to log the output of the search.lookupFields before trying to handle the result so you can see what's actually in there whether it's empty or not
💯 1
m
mdr
12/02/2021, 11:43 PM
Yeah I second logging the value. Especially since the format can be different depending on the field.
p
Phillip
12/02/2021, 11:45 PM
thanks
Phillip
12/02/2021, 11:53 PM
I was able to get it to working by checking if the value was null