Expand my Community achievements bar.

Adobe Summit 2025: AEM Session Recordings Are Live! Missed a session or want to revisit your favorites? Watch the latest recordings now.

Mark Solution

This conversation has been locked due to inactivity. Please create a new post.

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";

}