Using function result as attribute name


#1

Hi!

Sorry if my question is silly, but I’ve just began learning dynamics components!

So in my child component I want to have access to one of my parent components. I want to choose it, depending on witch Copy of my child am I.

so for copy 0 I want to get attribute called prefix_0, for copy 1 I want to get attribute with name prefix_1 etc.

I tried something like that: =parent!concatenate("prefix_", copy) apparently it does not work here.

So the question is: how can I access parent component attribute if the name of attribute I got only as a function result?


#2

use current(“attributename” & copy+1)

so for 5 sizes, size1,size2,size3,size4,size5,

for say lenx use…
= current(“size” & copy+1)
returns the value for each copy


#3

Thank you pcmoor!

current function does not allow me to get value of an attribute from parent.
for example =current(“parent!attribute_name”) will return me: “attrribute parent%21attribute_name not found” even if such attribute exist. Maybe you got some solution for that?


#4

place attributes in the child that references the parent,
size1 = parent!size1


#5

Now it’s clear. Thank you very much for your help!