How do I add rows to a table based on the amount entered in another field?

Avatar

Avatar

barbaras9901921

Avatar

barbaras9901921

barbaras9901921

13-06-2018

How do I add rows to a table based on an amount entered in another field instead of using an 'Add Row' button?

Accepted Solutions (0)

Answers (3)

Answers (3)

Avatar

Avatar

Magus069

MVP

Total Posts

1.0K

Likes

132

Correct Answer

150

Avatar

Magus069

MVP

Total Posts

1.0K

Likes

132

Correct Answer

150
Magus069
MVP

14-06-2018

Hi there,

technically, there is a way much easier than this.

assuming you have a minimum value for the row you can use the following code:

This will not simply add rows, it will create the number of rows specified in the other field.

Enjoy.

Avatar

Avatar

MinusZero

Avatar

MinusZero

MinusZero

14-06-2018

Thats awesome Magus069 for creating a easy resizing table. You can also use it in the exit event of a combo to 'restrict' how many rows can be in the table.

I saved that to my code archive.

Avatar

Avatar

MinusZero

Avatar

MinusZero

MinusZero

13-06-2018

It isnt difficult to do. Assuming you are already familiar with instances.

In a numericField exit event, add some if logic along the lines of this:

1508059_pastedImage_0.png

Note:

• This is a basic way of doing this to make it easier to understand, but you could more elegantly do it with a loop. A loop will also mean you dont have to have an if for every number. You could also use switch instead of if.

• This will always add the numbers of rows specified to the bottom of the table. It wont make the table the rows specified. ie. if you have three rows and specify three rows, the table with now have 6. If you exit the numericField again, the table with have 9 rows and so on.