List sorting in a very especific way

CODIGO SANEPAR.dyn (59.0 KB) SANMEC.xlsx (262.8 KB)

hi guys, i work with public sewer

my materials table looks like this, but i need to take the COD parameter from a SANEPAR sheet that is always changing codes. for that reason, i cant feed my families with the codes, and pipes are coded by diameter and length, ex (TUBO AÇO CARBONO DN 150 COMPRIMENTO ENTRE 1,5 E 2 METRO)

Im trying to use dynamo to read a 10k row sheet and take the code to itens in project

but, as soon as i get the rigth code, i cant figure out how to sort the elements to take back rigth code to every one

Hi there,

If I follow correctly what you are trying to do; you have families in your project file which have a specific material naming, and you want to get the matching code reference from the excel?

If so this sounds like a job for a dictionary node:

CODIGO SANEPAR (1).dyn (26.4 KB)

Just a quick note, the dictionary requires two data sets which have unique inputs. Your current data has duplicate codes and duplicate material names included in the excel. You will need to resolve this in your excel first

thank you for your reply. you understood exactly my problem
im trying to use “list.uniqueitens” before getting the data to the dictionary code

TY for the attention ! its working now !

actually im getting the wrong code for some elements after that

i have a different value of duplicate in each list, so the codes dont match when i create the dictionary. is there anyway i check if both lists are duplicated or get the index of the duplicate in each list so i can remove the duplicates in both lists ?

You can identify the re-used data inputs in your excel spreadsheet with the following method:

CODIGO SANEPAR_v2.dyn (51.0 KB)

Remember the indices start at 0 whereas excel starts at 1 so you will need to look up row references 1 number higher than shown in dynamo.