43
Views
3
Comments
Solved
Removing records from a list based on attributes from another list

I'm seeking assistance with managing two lists in OutSystems: listA and listB.

Both lists share the same data type: fat_WorkstationSkillTarget_PPE List, which includes the attributes:

  • id
  • ppe_fk
  • skillTarget_fk

My objective is to remove records from listA where the 'ppe_fk' matches any 'ppe_fk' in listB, so I'm leaft only with one record to delete from the database.

ListB records have their 'id' set to null.

Any guidance on how to achieve this would be greatly appreciated!

Thank you.

2025-06-28 01-52-12
Marco Mateo
Solution

Hi Michael,

You can do foreach for listB then for each record get the index from ListA. This will return the index of the same value from ListA. If the index is greater than -1 then that means it exist on ListA. Using the index, you use the ListRemove action to remove item from ListA. See sample flow below:


Hope this helps.


2023-08-18 10-40-36
Deepak M
Solution

Hi Michael Fernandes,

With the above flow. it will delete the first occurrence of List A, but there might be multiple records of the same element in the List A.

To delete the all occurrence of List A with matching condition of List B follow the below steps.



Thanks

UserImage.jpg
Michael Fernandes

Thanks a lot guys! It worked perfectly. I really appreciate your help! 

2023-08-18 10-40-36
Deepak M
Solution

Hi Michael Fernandes,

With the above flow. it will delete the first occurrence of List A, but there might be multiple records of the same element in the List A.

To delete the all occurrence of List A with matching condition of List B follow the below steps.



Thanks

2025-06-28 01-52-12
Marco Mateo
Solution

Hi Michael,

You can do foreach for listB then for each record get the index from ListA. This will return the index of the same value from ListA. If the index is greater than -1 then that means it exist on ListA. Using the index, you use the ListRemove action to remove item from ListA. See sample flow below:


Hope this helps.


2023-08-18 10-40-36
Deepak M
Solution

Hi Michael Fernandes,

With the above flow. it will delete the first occurrence of List A, but there might be multiple records of the same element in the List A.

To delete the all occurrence of List A with matching condition of List B follow the below steps.



Thanks

UserImage.jpg
Michael Fernandes

Thanks a lot guys! It worked perfectly. I really appreciate your help! 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.