# Assign double (value) to strings in list

**URL:** <https://forum.dynamobim.com/t/assign-double-value-to-strings-in-list/9356>\
**Category:** Lists-Logic\
**Created:** [February 3, 2017, 3:50pm UTC](https://forum.dynamobim.com/t/assign-double-value-to-strings-in-list/9356 "2017-02-03T15:50:03Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eugene\_Badere](https://avatars.discourse-cdn.com/v4/letter/e/d26b3c/32.png) [@Eugene\_Badere](https://forum.dynamobim.com/u/Eugene_Badere)\
**Post date:** [February 3, 2017, 3:50pm UTC](https://forum.dynamobim.com/t/assign-double-value-to-strings-in-list/9356/1 "2017-02-03T15:50:03Z")

</div>

![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/d/dddbbcdb1e172075b5fee8e3a9dbfe13da531b20.png)

This is a noob question but how do I assign double to strings in the list?  
E.g Perfect = 1.

The workflow would be:

1. Assign value to strings in list
2. If.ContainsItem node output is true, then get the value from the list
3. Final outcome: the double will be plugged as an input to the \* node.

---

<div class="post-metadata">

**Author:** ![Mostafa\_El\_Ayoubi](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mostafa_el_ayoubi/32/7815_2.png) [@Mostafa\_El\_Ayoubi](https://forum.dynamobim.com/u/Mostafa_El_Ayoubi)\
**Post date:** [February 3, 2017, 4:46pm UTC](https://forum.dynamobim.com/t/assign-double-value-to-strings-in-list/9356/2 "2017-02-03T16:46:32Z")

</div>

Hi @Eugene_Badere ,  
I think using a dictionnary would be the best approach for this kind of thing . You can use springnodes’ Springs.Dictionary.ByKeysValues for example :

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/8/a837d895d02550a2be3e93fc22b149bedca73de3.png)

---

<div class="post-metadata">

**Author:** ![Eugene\_Badere](https://avatars.discourse-cdn.com/v4/letter/e/d26b3c/32.png) [@Eugene\_Badere](https://forum.dynamobim.com/u/Eugene_Badere)\
**Post date:** [February 3, 2017, 7:16pm UTC](https://forum.dynamobim.com/t/assign-double-value-to-strings-in-list/9356/3 "2017-02-03T19:16:58Z")

</div>

Thanks for the idea! Though I was looking for a way to assign values without using custom nodes, I was able to replicate this solution using the dictionary from Lunchbox.

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/c/acddceddfc529d46adfac7469872ca72ebd85f99.png)

---

<div class="post-metadata">

**Author:** ![Mostafa\_El\_Ayoubi](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mostafa_el_ayoubi/32/7815_2.png) [@Mostafa\_El\_Ayoubi](https://forum.dynamobim.com/u/Mostafa_El_Ayoubi)\
**Post date:** [February 3, 2017, 7:20pm UTC](https://forum.dynamobim.com/t/assign-double-value-to-strings-in-list/9356/4 "2017-02-03T19:20:40Z")

</div>

yes same thing. But Lunchbox dictionary is a custom node as well you know 🙂

---

<div class="post-metadata">

**Author:** ![Kulkul](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/kulkul/32/49801_2.png) [@Kulkul](https://forum.dynamobim.com/u/Kulkul)\
**Post date:** [February 3, 2017, 7:55pm UTC](https://forum.dynamobim.com/t/assign-double-value-to-strings-in-list/9356/5 "2017-02-03T19:55:09Z")

</div>

Hi @Eugene_Badere

> [@Eugene\_Badere](#):
>
> Though I was looking for a way to assign values without using custom nodes

Here is one of the possible way without using custom nodes.

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/8/c8203fe7b79f0b0686e41f4970a59850a5933f3a.png)

---

<div class="post-metadata">

**Author:** ![Einar\_Raknes](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/einar_raknes/32/8566_2.png) [@Einar\_Raknes](https://forum.dynamobim.com/u/Einar_Raknes)\
**Post date:** [February 3, 2017, 9:46pm UTC](https://forum.dynamobim.com/t/assign-double-value-to-strings-in-list/9356/6 "2017-02-03T21:46:33Z")

</div>

You can also use Design Script (Code Block) Dictionary:

> [@Searching the matching Index and transferring the index to another list](https://forum.dynamobim.com/t/searching-the-matching-index-and-transferring-the-index-to-another-list/7935/4):
>
> As @Yna_Db stated you can use dictionaries for this. Don’t have to use custom nodes either. Designscript have that capabilities “in-house”.

---

<div class="post-metadata">

**Author:** ![Eugene\_Badere](https://avatars.discourse-cdn.com/v4/letter/e/d26b3c/32.png) [@Eugene\_Badere](https://forum.dynamobim.com/u/Eugene_Badere)\
**Post date:** [February 4, 2017, 8:02am UTC](https://forum.dynamobim.com/t/assign-double-value-to-strings-in-list/9356/7 "2017-02-04T08:02:09Z")

</div>

Thank you guys!
