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
BedrockMission!

Learn More

View all

Sign in to view all badges

Hide repeating table row based on value?

Avatar

Avatar
Validate 1
Level 1
matthewh7973307
Level 1

Like

1 like

Total Posts

2 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
matthewh7973307
Level 1

Like

1 like

Total Posts

2 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
matthewh7973307
Level 1

06-08-2019

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

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Springboard
MVP
Magus069
MVP

Likes

143 likes

Total Posts

1,072 posts

Correct Reply

155 solutions
Top badges earned
Springboard
Validate 1
Ignite 3
Ignite 1
Establish
View profile

Avatar
Springboard
MVP
Magus069
MVP

Likes

143 likes

Total Posts

1,072 posts

Correct Reply

155 solutions
Top badges earned
Springboard
Validate 1
Ignite 3
Ignite 1
Establish
View profile
Magus069
MVP

06-08-2019

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..

Answers (2)

Answers (2)

Avatar

Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile

Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
MVP

11-08-2019

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

Avatar

Avatar
Validate 1
Level 10
Mayank_Gandhi
Level 10

Likes

284 likes

Total Posts

1,105 posts

Correct Reply

182 solutions
Top badges earned
Validate 1
Contributor 2
Ignite 5
Ignite 3
Ignite 10
View profile

Avatar
Validate 1
Level 10
Mayank_Gandhi
Level 10

Likes

284 likes

Total Posts

1,105 posts

Correct Reply

182 solutions
Top badges earned
Validate 1
Contributor 2
Ignite 5
Ignite 3
Ignite 10
View profile
Mayank_Gandhi
Level 10

06-08-2019

Can you send the form please?