Skip to main content
Solved

InstanceNode setProperty function not updating as expected


Ilakkiaselvan_Subbiah

When I try to set text property as below, I don’t get any error and value is also not updated.

property =“Minorvalue#410:36”;
instanceNode.setProperty({property:“Sample Text”});

But when I do the same like below I am able to set the value

instanceNode.setProperty({“Minorvalue#410:36”:“Sample Text”});

“property” is string so I couldn’t figure out what I am missing here 😦

Best answer by tank666

In order for JavaScript to understand that you are passing a variable as an object key, you must follow its syntax, and specify as [key].

View original
This topic has been closed for replies.

3 replies

tank666
  • 4873 replies
  • Answer
  • August 21, 2023

In order for JavaScript to understand that you are passing a variable as an object key, you must follow its syntax, and specify as [key].


Ilakkiaselvan_Subbiah

Thanks @tank666 .


  • 0 replies
  • August 24, 2023

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings