Lookup Data Table result not found

Hi everyone,

I have a lookup data table where the lookup variable is based on a report where a user picks one of two options. Sometimes that entry isn’t found, and in those cases I want to try the other option.

It runs through several lines on the report before it comes across one where it can’t match the entry.
Then it always crashes.

When I set up the if statement after the lookup, I tried a few things and nothing works:

  1. IF: str_LookupResult = “”
  2. IF: string.isnullorempty(str_LookupResult.trim)
  3. IF str_LookupResult is nothing

all of these return an “Object reference not set to an instance of the object” error highlighting the “If”.

I tried doing an assign before the lookup, declaring str_LookupResult = “something”,
then setting my IF: "str_LookupResult = “something” " in case it just didn’t touch it when it returns nothing… still get the same error message. I’m very confused.

What does the lookup data table return if it doesn’t match anything in the table?

Thanks,
Ryan

Hi @Astrys,
I encountered the same situation, it turns out it returns -1 if it doesn’t match anything.

Hope this helps