FilterByBoolMask culling empty lists


#1

Hi

When using the ‘List.FilterByBoolMask’ node in some instances it is culling the empty list and in other instances it isn’t. It is also renumbering the index of the list. I need it to maintain the list structure. How can I do this?

 

List Map 1

 

 

 

 

 

 

 

 

List Map 2

 


#2

List Map 1


#3

It’s hard to say what is actually happening here since you’re not showing the list that is being filtered. My best guess is that this is another case where using List.Combine makes more sense than using List.Map …


#4

Hi Andreas

I don’t understand your comment. The list that is being filtered is correct. What I need is this: If it is false, return null. If it is true, replace the value of the correct index. It is kinda working except it is culling the null values and changing the data tree.


#5

My comment was referring to the fact that in your screenshot we don’t see the structure of the list that is being filtered. It’s hard to give you any meaningful feedback that way.


#6

Hi Paul,

I don’t think the “List.FilterByBoolMask” will help you in your case. Have you tried the If node?

2015-02-04_141227

The correct use of “List.FilterByBoolMask” is to compare two equal lists, one of which containing only Boolean values. It won’t work for mismatched lists.


#7

Paul, see the previous discussion. If you replace your empty lists with a value of say ‘N/A’ then run the filter you may have more of a success.

 

http://dynamobim.com/forums/topic/putting-a-value-to-empty-lists/


#8

Or this one

http://dynamobim.com/forums/topic/if-equal-return-index-error/


#9

Thanks for the responses. In the end I used the ‘List.GetItemAtIndex’ as suggested by Mark. Still not sure why List.FilterByBoolMask is renumbering paths in my original script but this workaround is working so all good.

 

Filter By Bool