Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

GetPossibleValues returns no value

Hi.

I have a macro which loops through a table of salesreps and emails them a report. I use the GetPossibleValues function to get the relevant email address for the salesperson from the rep table. I am striking a problem when the email address is blank in the table and therefore the GetPossibleValues does not return a value. This results in a macro error. If there is a null value returned then I'd like to use a generic email address instead.

Is there some command to identify that no value has been returned and take some alternate action?

Thanks, Kevin

2 Replies
Not applicable
Author

Hi,

After getting possible values before accessing the values you can check for the count

sub getp()

set val=ActiveDocument.Fields("F3").GetPossibleValues

    if val.Count=0 then msgbox "hi"

for i=0 to val.Count-1

    msgbox(val.Item(i).Text)

next

end sub

incase the count is ZERO assing the default mail id.

Cheers.

Jason_Michaelides
Partner - Master II
Partner - Master II

Or you could fill in blanks in the script with a map....using statement.