Copying list and Checking the count of the list

Copying list and Checking the count of the list

  

Hi,

I have a list which contains list of email id's with True or false state in it.

(i.e)   [email] - xyz@a.com , [selected] =1 & 

 [email] -ac@x.com ,[Selected] =0

I have to copy only (Seleced=1) emails into one more list and then check the count of this copied list whether it is >=10 and then I have a through a error message.

Could you please help me in this can be implemented in outsystems.

Thanks in Advance 

Hi Vetrivel,

I assume you have the user select the e-mail addresses to send something to, and you want to limit this to 10 addresses? In that case I also assume the list isn't that long (100 max?)? If so, use the ListFilter (with selected = true), and check the Length of the output (in fact, I think that would be the recommended way even if the list is longer, ListFilter is pretty fast, and faster than explicitly looping over the list).

Hi Kilian,

I need to copy a existing list to a new list. How to do this in outsystems.

Can u send me a screenshot of Steps to do that.

Hi Vetrivel,

There's no need for screen shots or steps, it's just a single Action: ListDuplicate. Please refer to the documentation for more information about lists.

Also, you didn't tell us whether your original question was answered. If so, please mark my reply above as the solution.

Hi Kilian,

In Outsystem 9.1.601.0  I dont see a list filer function.How to do it in  outsytem 9 manually.

Thanks!!

Solution

Hi Vetrivel M,

If you need to do that sort of filtering in OutSystems 9.1, you can:

  • define a local variable FilteredList of the same data type as the original list, and
  • use the For Each tool on the original list.
  • On the Cycle branch you need a Condition testing selected = true.
    • If true you add that record to the FilteredList, otherwise you do nothing.
    • In both cases, afterwards you continue back to the For Each.
  • When the For Each ends, your FilteredList will hold all the records that where selected and you can check the FilteredList.Length to see whether it is less than 10.

Hope this helps.

Solution

Jorge Martins wrote:Am new to this outsystem. Can you provide step by step Screenshots of following Steps?

Hi Vetrivel M,

If you need to do that sort of filtering in OutSystems 9.1, you can:

  • define a local variable FilteredList of the same data type as the original list, and
  • use the For Each tool on the original list.
  • On the Cycle branch you need a Condition testing selected = true.
    • If true you add that record to the FilteredList, otherwise you do nothing.
    • In both cases, afterwards you continue back to the For Each.
  • When the For Each ends, your FilteredList will hold all the records that where selected and you can check the FilteredList.Length to see whether it is less than 10.

Hope this helps.



Hi Vetrivel M,


If you find difficulty in implementing the Jorge Martins solution please refer to the attached .oml


Cheers,

Benjith Sam

Vetrivel M wrote:

Am new to this outsystem. Can you provide step by step Screenshots of following Steps?

Vetrivel, did you take the on-line courses? Everything Jorge explained is basic stuff that's handled in there. We're here to help you with the more advanced stuff, but we're not teachers running a course!

thanks for your valuable suggestion. i have done all the Basis, and this is not a sample test project where , i am testing it out the basics. i am working on application which is fully build on out system platform. is there a way, to have a screen sharing session, to show the issue that i am facing it?

Hi Vetrivel,

Various people have explained how you could handle what you described. What don't you understand? Or do you have a new question?