cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

How to update the number of rows of an infotable?

YD_9850038
8-Gravel

How to update the number of rows of an infotable?

Hello experts, 

 

I have an infotable called XXX for example, the infotable has a datashape that has only one attribute called element, so if a add one element, from Prperties and services the infotable appears like XXX(1), if i add other element, it changes to XXX(2).... i want a service to update the number of element based on the number i will give, i mean if i give 5 the number of elements in my infotable it changes to XXX(5). 

 

 

Thanks, 

Youssef

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi,

When I spoke about a for loop, I did not refer to running through the infotable, but to add rows to an empty infotable to reach your desired count.

Following pseudocode (not real Javascript code)illustrates my idea:

for (var y=0;y<desiredNumOfRows;y++)

{

        myInfotable.AddRow(newRow);

}

View solution in original post

8 REPLIES 8
slangley
23-Emerald I
(To:YD_9850038)

Hi @YD_9850038

 

Hopefully, we're interpreting your question correctly.  The number in parentheses indicates the number of rows in the infotable.  If you want to change it to 5, you would need to add 5 rows, though it's not clear what the intent is.

 

Please provide more information and we'll try to assist.

 

Regards.

 

--Sharon

Hello Sharon, 

 

 

Thanks for the reply!

What i need, instead of using the function addRow, when i give a number like 8 for example automaticaly it creates 8 rows in the infotable. 

I saw in javadoc and did find any function like setRow or something similar. 

 

Regards, 

Yous

slangley
23-Emerald I
(To:YD_9850038)

Hi @YD_9850038.

 

I'm afraid we still need more information.  What is your use case?

 

Regards.

 

--Sharon

Hello Sharon, 

 

The use case is : 
I have a field called RowNumbers and an infotable called Dimension, when i put any number as input in RowNumbers field i want infotable to create that number of rows, i mean RowNumbers = 15 ----> Dimension(15),  RowNumbers =5 --->Dimension(5)... . 

 

Regards, 

Yous

Hi @YD_9850038 ,

That seems like the perfect use for a javascript "for" loop.

Is there any reason why you can't use that in a service?

Hello Vladimir, 

 

My use case not running through the infotable, however controls the number of rows with the value i will be giving in a text field. 

 

Regards, 

Yous

 

 

Hi,

When I spoke about a for loop, I did not refer to running through the infotable, but to add rows to an empty infotable to reach your desired count.

Following pseudocode (not real Javascript code)illustrates my idea:

for (var y=0;y<desiredNumOfRows;y++)

{

        myInfotable.AddRow(newRow);

}

View solution in original post

slangley
23-Emerald I
(To:YD_9850038)

Hi @YD_9850038.

 

If you feel your question has been answered, please mark the appropriate response as the Accepted Solution for the benefit of others with the same question.

 

Regards.

 

--Sharon

Announcements