How to use List in Email Template ?

How to use List in Email Template ?

  

Hi Team,

I have list with 2 columns. 1st column has Application ID and 2nd has Group ID. This list will have multiple Application ID and Group ID associated to it. My requirement is to display this list in a Email template, but OutSystems does not allow me to create a List parameter in Email templates.

I tried to create a Session Variable as List type but it gave a warning, in spite of warning I created List type session variable and used it in the preparation of email template, but the value was Null :(

I could not create a entity also because if the application is accessed by 2 users at a time then it will be a complete mess.

I could not use Comma Separated values too. So can you suggest me some better way to fulfill my requirement.


Thanks in advance

Mehraj 

   

Hi Mehraj,

How is your list getting created?

Is it inside some action after some operation or you are getting it through aggregate?

Why can't you use Comma separated values? You can collect these IDs in comma separated values inside one local variable, pass those IDs as input parameter to Email. Inside preparation of email, write one advance query which will fetch you Application ID and Group ID and where clause will be comma separated values and assign that Advance Queries result to Table Records inside email.

Let me know if this works.

Thanks,

Suraj Borade

Hi Mehraj,

You can refer this post Pass recordlist to Email.

If you need further help, please share your sample oml.

Thanks,

Suraj Borade

Mehraj,

You can use a temporary table by using some unique ID (e.g. use the GenerateGuid() function from System), then pass that UUID as a parameter to the e-mail screen. In the preperation, you can then query all records with that UUID. For a comma-seperated list, you can iterate over the list and add the IDs one by one to a text variable. If there are only a small number of IDs, that'll work fine (you wouldn't want 1000s of rows in an e-mail anyway).

Thanks Suraj and Kilian,

I used comma separated list and its works for me :)