DBLookup on mail groups

I have a DBLookup that pulls all mail groups from my NAB. This function works perfectly but I would like to limit it to the users location.

For example if the user is at location “WRO” I only want mail groups that start with WRO displayed. I have tried uses @Matches but can’t seem to get a handle on it.

The mail gropups always start with the location ex. WRO All Employees.

Does anyone have an idea of what I should use to get the correct match?

Thank you

Subject: RE: DBLookup on mail groups

_groups := @DbLookup(…);@Transform(_groups; “_x”; @If(@Begins(_x; Location + " "); _x; @Nothing))

Subject: RE: DBLookup on mail groups

Andre you are a genius!!! Thank you so much it works great.

Subject: RE: DBLookup on mail groups

Couldn’t you use [Partialmatch]?

@DbLookup(“”:“NoCache”; “FID001-MAIL001”:“Names.nsf”; “($Groups)”; YourLocationFieldName+" "; 1; [PartialMatch])

Subject: DBLookup on mail groups

How does the user tell the function what location they are in? Can you post your dblookup formula?

Subject: RE: DBLookup on mail groups

There is a field on the form where they chose the location from a pick list. The code for the DBLookup is below:

L1 := @DbColumn(“”:“NoCache:”;“FID001-MAIL001”:“Names.nsf”;“Groups”;2);

L2 := @DbColumn(“”:“NoCache:”;“FID001-MAIL001”:“Names.nsf”;“($Groups)”;2);

@Trim(@Replace(L1; L2; “”))