Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to get group labels via macro

Hi,

This is an example from the API-guide to get all fields/definitions in a group.

groups = ActiveDocument.GetGroups

set gp = groups(0).GetProperties

set vars = gp.FieldDefs

for i = 0 to vars.Count-1

   set fld = vars(i)

   msgbox("field " & i+1 & " is " & fld.Name)

next

But how do i get the label? I tried:

   msgbox("label " & i+1 & " is " & fld.Label)

But did not work. Doesn't seem to find it in the API-guide.

Cheers

Martin

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Try something like this:

sub GetLabels

 

groups = ActiveDocument.GetGroups

set gp = groups(0).GetProperties

vars = gp.Labels

msgbox vars(0)

 

for i = 1 to ubound(vars)

   msgbox vars(i)

next

 

end sub


talk is cheap, supply exceeds demand

View solution in original post

1 Reply
Gysbert_Wassenaar

Try something like this:

sub GetLabels

 

groups = ActiveDocument.GetGroups

set gp = groups(0).GetProperties

vars = gp.Labels

msgbox vars(0)

 

for i = 1 to ubound(vars)

   msgbox vars(i)

next

 

end sub


talk is cheap, supply exceeds demand