Create if not present in list

Hi,

I'm trying to compare a local file list with aggregate list and if the file name is already present it will continue iteration or else it needs to create the file.

Solution

Hi Balaji,

You can use Listfilter action inside your loop and provide the source list and condition.

somewhat like tolower(locallist.filename) = tolower(aggregate.table.filename)

then use the if widget and based on whether the Listfilter is empty (if condition : ListFilter.FilteredList.Empty) or not you can create the record or iterate the loop.

Also attached  the sample oml of yours.

Thanks,

Lakshmi Kumar Yadav

Solution

Lakshmi Kumar Yadav wrote:

Hi Balaji,

You can use Listfilter action inside your loop and provide the source list and condition.

somewhat like tolower(locallist.filename) = tolower(aggregate.table.filename)

then use the if widget and based on whether the Listfilter is empty (if condition : ListFilter.FilteredList.Empty) or not you can create the record or iterate the loop.

Also attached  the sample oml of yours.

Thanks,

Lakshmi Kumar Yadav

But it will cause an exception since already an list is being iterated and if you access a filtered list inside the iteration. So it won't work I think or can you show an example.


Hi Balaji,

i have attached the updated sample oml provided by you in previous comment.

please refer.


Thanks,

LK 

Lakshmi Kumar Yadav wrote:

Hi Balaji,

i have attached the updated sample oml provided by you in previous comment.

please refer.


Thanks,

LK 

Yeah you're right I've passed the wrong list and so it has thrown an exception.It works perfectly fine as you've mentioned there.Thanks for your help.