Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Textfield value based on addinstance value

Avatar

Level 4

if (this.parent.instanceManager.count = 1){

  this.rawValue = " Yellow";

} else{

this.rawValue = "Pink";

}

i use this script in a dynamic form

but always same value appeared in all new addinstance

plz help whats wrong in script.

1 Reply

Avatar

Level 10

Your comparison operator is wrong. It has to be either == or === but not =.

Try this.

if (this.parent.instanceManager.count == 1){

  this.rawValue = " Yellow";

} else{

this.rawValue = "Pink";

}