Changing the name of material via few if conditions

I need to change full material name into a code. I figured out how to get material name but now I am trying to use few if conditions to change this names and paste them in the parameters.
Do you guys know why do I get red node?

It is polish language, but in fact I just want to change “Tworzywo sztuczne” into “PLA” and “Stal czarna” into “STA”
P.S. 2
It works with one condition, I got problems with two


Maybe this will work?

Ok but what If I would like to do the same thing with about 10 types of materials?

When you want to do it with more materials you can use the node “List.Groupbykey”

Seems good, many thanks, but I just wonder why can’t I compare some parameters via easy “if” node? Why can’t I check if parameter’s value=“string” and if yes, then do something, if no do something other?

I’ve got the same problem here: I just want to check if parameter “Skrót nazwy systemu” equals “CWU” or “ZWU” or “CYRK”. If yes then write “WO” in other cases write the same value of this parameter.

Why do I ask for it? Becouse I am creating quiet complicated element code which contains few elements and this one is one of this elements. It gets really big If I have to check every single material by few blocks. If statement is much easier.

Maybe you can use the ScopeIf+ node from clockwork?

I got this, Dictionary nodes made the job. I’ve definied that every “CYRK” “CWU” and “ZWU” needs to be changed with “WO” then I filtered the rest with Object.IsNull and when there is other case than this three use standard name.
That’s the solution for both cases.

Good to hear!