Appending a list using a formula

Hi,

I have a computed for display field on a form which uses an @for loop to perform an @dblookup for each iteration. I need to append the resulting list (Users) from each lookup to a temp variable (AppNames), but I cannot get it to work. Any help would be appreciated. I am almost certain the issue is with this line

AppNames := AppNames + Users

The Code

Roles := @UserRoles;

AppNames := “”;

@For(n := 1; n <= @Elements(Roles); n := n+1;

Users := @DbLookup(“”:“NoCache”;“”;“va_Approvers”;Roles[n];2);

AppNames := AppNames + Users

);

@implode(AppNames; “;”)

Subject: Appending a list using a formula

The list concatenation operator is “:”, so:

AppNames := AppNames : Users;

Subject: RE: Appending a list using a formula

Hi Stan,

Thanks for the quick response. I tried that and I am getting the following error:

Field: “NameOfField” Entry not found in index

Subject: RE: Appending a list using a formula

That means that at least one go-through of the @DbLookup is failing. Use the [FailSilent] keyword to prevent the error showing through. And use @Trim around the AppNames list before @Imploding it.

Subject: RE: Appending a list using a formula

Hi Stan,

That worked! Thanks a lot for the advice. Very much appreciated.