Skip to main content
Solved

Dynamic properties names


Forum|alt.badge.img+3

Hi,

Is it possible to concatenate strings to call a propertie.

Something like that

 textarea: {
        text: '{{=parent.CONCATENATE("out",ASSTRING(@i))}}',
        name: 't1',
        editable: true,
        style: { 'color': "#000000" }
      }

I want to assigne to each textarea the propertie out1, out2 etc. based on the index @i

 

I found a way to make it works using IF statement, but it’s not ideal :

{{=IFERROR(IFS(@i=1,parent."in1",@i=2,parent."in2",@i=3,parent."in3",@i=4,parent."in4",@i=5,parent."in5"), "error")}}

Thanks for your help

Best answer by Nathan Kim

Hello NM!

While it would be useful to directly concatenate to form a property name within a text area, here is another idea that I have.

You could get parts of the names (as strings) and concatenate them to a longer string. Then you could use that longer string as a property name, by passing it to the GET formula, along with the parent shape object.
For example, something like this may work:
```
"text": "{{=GET(PARENT, CONCATENATE(\"out\", @i))}}",
```

If this doesn’t work for you, I can try to modify this for your specific use case. If you have any questions about it, please let me know -- thank you!

-Nathan

View original
Did this topic help you find an answer to your question?

Humas1985
Lucid Legend Level 9
Forum|alt.badge.img+21
  • Lucid Legend Level 9
  • March 19, 2025

Hi ​@NMN 

While the current functionality doesn't support dynamic concatenation of property names within the textarea, leveraging data linking or scripting can offer more scalable solutions for the scenario.

Hope this helps - Happy to help further!!
Thank you very much and have a great one!
Warm regards

 


Nathan Kim
Forum|alt.badge.img+2
  • Lucid product team
  • March 19, 2025

Hello NM,

As a workaround, you can concatenate text and formula results, within the template string. For example, for your case, you can do something like
```
text: ‘out{{=@i}}’,
```
to wrap the text and index together.


If this doesn’t work for your use case, let me know! Other workarounds might be possible, and I’m happy to discuss them.

Thanks,

-Nathan


Forum|alt.badge.img+3
  • March 20, 2025

Hello Nathan,

I need to display the value of the property ‘parent.out1’, not just its name.

If you have other ideas, great! It seems that Humas thinks it’s not possible to do for now.

Thanks again,

NM

 

 

 


Nathan Kim
Forum|alt.badge.img+2
  • Lucid product team
  • March 20, 2025

Hello NM!

While it would be useful to directly concatenate to form a property name within a text area, here is another idea that I have.

You could get parts of the names (as strings) and concatenate them to a longer string. Then you could use that longer string as a property name, by passing it to the GET formula, along with the parent shape object.
For example, something like this may work:
```
"text": "{{=GET(PARENT, CONCATENATE(\"out\", @i))}}",
```

If this doesn’t work for you, I can try to modify this for your specific use case. If you have any questions about it, please let me know -- thank you!

-Nathan


Forum|alt.badge.img+3
  • March 21, 2025

Hello Nathan,

It’s working great ! The Get formula was the missing element.

Thanks a lot,

NM


Reply