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

SOLVED

Hide repeating table row based on value?

matthewh7973307
Level 1
Level 1

Hi,

I'm having difficulty with a scripting problem. I would like to hide any table row 'DATA_COND' where VTEXT within that row is equal to "Price".

This is the code I have created that does not work:

for (var a=0;a<data.BODY.ITEM_DETAIL.DATA_DETAIL.count;a++){

for (var b=0;b<data.BODY.ITEM_DETAIL.DATA_DETAIL[" + a + "].DETAILS.ITEM_CONDITIONS.CONDITIONS.DATA_COND.count;b++){

  if (xfa.resolvenode("data.BODY.ITEM_DETAIL[" + a + "].DATA_DETAIL.DETAILS.ITEM_CONDITIONS.CONDITIONS.DATA_COND[" + b + "].VTEXT").rawValue== "Price"){

   xfa.resolvenode(data.BODY.ITEM_DETAIL[" + a + "].DATA_DETAIL.DETAILS.ITEM_CONDITIONS.CONDITIONS.DATA_COND[" + b + "]).presence="hidden"; 

   }

  }

}

Where DATA_DETAIL repeats for each item and DATA_COND repeats for each item

Any pointers to where I might be going wrong?

Many Thanks!

Matt

1808071_pastedImage_0.png

1 Accepted Solution
Magus069
Correct answer by
Level 10
Level 10

Hi there,

there's some minor details you need to fix in your code, see the following:

Bold text is where I amended the code

instanceManager needs to be accessed to manage instances of the object itself.

It also can be accessed by using an underscore before the name of the object in question like the following:

I hope this will help

Let me know if you need clarifications..

View solution in original post

0 Replies
Magus069
Correct answer by
Level 10
Level 10

Hi there,

there's some minor details you need to fix in your code, see the following:

Bold text is where I amended the code

instanceManager needs to be accessed to manage instances of the object itself.

It also can be accessed by using an underscore before the name of the object in question like the following:

I hope this will help

Let me know if you need clarifications..

View solution in original post

Manqoba
Level 1
Level 1
Hi I'm having the same issue and I can't see your amendments. Please assist. Thank you
Mayank_Gandhi
Community Advisor
Community Advisor

Can you send the form please?

radzmar
Level 10
Level 10

You can propably do the same with just one line of code in the calculate event of "DATA_COND":

this.presence = VTEXT.rawValue === "Price" ? "hidden" : "visible";