Lists and Filtering Advice

Lists and Filtering Advice

  

Hi all, I'm after a bit of advice as to the best way to approach this issue:

I have an AccountSummaryWrapper being returned from an API which contains a list of tenancies. Each of these tenancies contains a list of Accounts:

The Tenancies structure has a Status for each tenancy, and I would like to 'split' my list of tenancies in the account wrapper into two lists: one where the Status = "CUR" and one where the status is not "CUR". I assumed that I could use ListDuplicate to give myself the two lists, and then filter each list somehow using ListFilter, but even though it's all drag and drop, I can't seem to get the logic to work.

I read the documentation about lists, and am getting myself more baffled. Has anyone got an idea of how best to achieve this, and is list duplicating and filtering the way forward?

I am wanting to show a summary on the screen of values in the tenancy (ID, Name and Status) where the Status = "CUR", and below that show a list of the other accounts that are not "CUR" in another box. If there is a way to just 'pull out' a specific list item with a condition that I guess that would also work? All ideas greatfully accepted!!

Solution

Hi Rusell,

I don't think you need to ListDuplicate anything, as the ListFilter already creates a new list. And yes, ListFilter should just work fine. When you say "I can't seem to get the logic to work", what exactly doesn't work here?

Solution

Kilian Hekhuis wrote:

Hi Rusell,

I don't think you need to ListDuplicate anything, as the ListFilter already creates a new list. And yes, ListFilter should just work fine. When you say "I can't seem to get the logic to work", what exactly doesn't work here?

Hi Kilian,

I was struggling with how to access the output of the ListFilter. I couldn't see anywhere to assign it to another list for example, but then after clicking away and clicking back to the server action I found the below:

It seems I should now be able to work with this new list. Thank you for providing that spark :)

I'll no doubt be back with another question later!

Yes, the ListFilter has a "FilteredList" output of the same type as the input List. That's a new List that you can use like any other List.