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

Updating Global Variables

Avatar

Avatar
Validate 1
Level 1
MikhaelJ
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
MikhaelJ
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
MikhaelJ
Level 1

14-06-2017

I am trying to use a global variable to update row numbers in a repeating subform. I defined a variable 'rowCount' where the value is "1" from the Form Properties > Variables menu. I would like that value to go up by 1 whenever a user clicks something like an 'add row' button. I tried the following, and searched around but can't seem to find the answer:

rowCount.value = rowCount.value + 1;

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

269 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

269 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile
_Bruce_Robertson
MVP

16-06-2017

Hi,

Your code should execute, though rowCount.value will be a string so you will get concatenation, so "11", "111", "1111" etc.

The Designer UI does not support numeric global variables but you can create them by using the XML Source view.  You will find something like;

<variables>

    <text name="rowCount">1</text>

</variables>

You can then change the text elements to integer, so it looks like;

<variables>

     <integer name="rowCount">1</integer>

</variables>

There is more on this in this blog post, Form Variables

An alternative approach would be to use the index property of the repeating subform, this property is incremented for each object with the same name.  There is an example of this in another blog Adobe LiveCycle Designer Cookbooks by BR001: Numbering rows in a LiveCycle Designer table or repeati...

Regards

Bruce

Answers (1)

Answers (1)

Avatar

Avatar
Validate 1
Level 1
MikhaelJ
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
MikhaelJ
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
MikhaelJ
Level 1

19-06-2017

Changing it to integer worked. Thanks!