CHOOSE function troubles

I don’t understand why the first one works and the second one doesn’t.
Thanks in advance

Could you upload the file? Try making the objects into components not groups and making them unique.

The first one works by luck.

Agree. You can get away with using Groups sometimes but it’s usually best to use Components.

Also, the parent group does not have an attribute named “tipo”. When you reference an attribute in a formula, the attribute is searched for in the current object. You need to reference the child component in the formula. This makes more sense when the child has a unique name other than “Group”. The formula for the attribute m should be similar to this:

m: =CHOOSE("NameOfChild!tipo", "Green", "Orange")

The CHOOSE function works like an iterator, it uses the value of the first argument to pick out of the ‘array’ of rest of the arguments.

So you need an attribute that defines the choise:
eg. ‘Type’ and let the user choose from a list which values are set to 1,2,3,etc.
For the attribute which has the CHOOSE function, you would then have something like:
Material=CHOOSE(Type, ‘Green’,’Red’,’Blue’)
(Note that these common used materials can be used in the Standard Attribute ‘Material’, if you want other materials, they would need to be in the ‘In Model’ collection)
Check this HEA:

Thank you guys. I will try again.