Dynamo Dictionary.valueatkey

Working a pricing script, and ran into a problem recently I can’t seem to figure out.

the Valueatkey above is just pulling in a list of valid part numbers, the dictionary definitions are part numbers with a value of the prices. (All Part numbers are valid and exist on the list with a price, or N/A, imported as strings for prices.)
I’ve verified the list is complete and all columns are equal lengths. my dictionary definitions are complete correct.

Dictionary.Valueatkey with a single string pulls a single key and a list of nulls, and running a list of part numbers they all null. Why am I not seeing a list of valid prices on the ValueatKey fed in from the list of element.getvaluebyname?

It looks like you created your dictionary incorrectly. Instead of one dictionary with 3853 keys/values you have 3853 individual dictionaries, each with only a single key/value.

3 Likes

Ahh makes sense… flatten the list first, thanks!


Seriously can’t say thank you enough. This was wracking my brain for a few days.

2 Likes