# "if" logic between lists is being truncated

**URL:** <https://forum.dynamobim.com/t/if-logic-between-lists-is-being-truncated/105742>\
**Category:** Lists-Logic\
**Tags:** designscript, dynamo\
**Created:** [November 11, 2024, 4:15am UTC](https://forum.dynamobim.com/t/if-logic-between-lists-is-being-truncated/105742 "2024-11-11T04:15:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Julie\_Kidder](https://avatars.discourse-cdn.com/v4/letter/j/f17d59/32.png) [@Julie\_Kidder](https://forum.dynamobim.com/u/Julie_Kidder)\
**Post date:** [November 11, 2024, 4:15am UTC](https://forum.dynamobim.com/t/if-logic-between-lists-is-being-truncated/105742/1 "2024-11-11T04:15:30Z")

</div>

I am trying to build a new list using a boolean condition to select the right sublist. It seems like it should be doable with a simple if statement, and I can get close using design scripts if logic, but it is truncating the values in the list.

 ![truncated if statement](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/7/2707a5447754aed13ea5a69dd3487505ce31edf1.png)

I have tried using the if, list.map and list.combine nodes, but all of them pull the entire source list instead of the just the value at the same index in the source list. I have tried multiple versions of lists at level to try to get those to work.

Test image shown, goal is to be pulling data from dictionaries via following design script (TryGetValueAtKey is from archilab, but same error occurs when using the inbuilt GetValueAtKey)

```auto
(Dictionaries.TryGetValueAtKey(tests, key)?Dictionaries.TryGetValueAtKey(accent, key) : Dictionaries.TryGetValueAtKey(field, key));

```

Why is the list being truncated with the designscript if logic? How can I get the full sublist at the same index of the correct list based on logic?

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [November 11, 2024, 6:50am UTC](https://forum.dynamobim.com/t/if-logic-between-lists-is-being-truncated/105742/2 "2024-11-11T06:50:13Z")

</div>

Try adjusting the lacing - longest if memory serves.

---

<div class="post-metadata">

**Author:** ![Julie\_Kidder](https://avatars.discourse-cdn.com/v4/letter/j/f17d59/32.png) [@Julie\_Kidder](https://forum.dynamobim.com/u/Julie_Kidder)\
**Post date:** [November 11, 2024, 8:00pm UTC](https://forum.dynamobim.com/t/if-logic-between-lists-is-being-truncated/105742/3 "2024-11-11T20:00:11Z")

</div>

Thanks! Longest lacing worked on the if node to get the desired result.
