Table creation with dynamic row and column at run time

Hello All,

I have a requirement where i have a form and need to create a table based on the two input values as rows and column.

Columns names should also be auto-generated as variable1,variable2 etc. based on the input value wrt to the column.

Similarly with the row as row1, row2,etc based on the input value wrt to the row.

table rows should be editable.

After adding data i should be able to store the data to the database and when i open this form again then automatically table should be generated and value should be populated from database.


Canany one can help me on this?

Thanks in Advance,

Fresher.Outsystems b wrote:

Hello All,

I have a requirement where i have a form and need to create a table based on the two input values as rows and column.

Columns names should also be auto-generated as variable1,variable2 etc. based on the input value wrt to the column.

Similarly with the row as row1, row2,etc based on the input value wrt to the row.

table rows should be editable.

After adding data i should be able to store the data to the database and when i open this form again then automatically table should be generated and value should be populated from database.


Canany one can help me on this?

Thanks in Advance,


Hi,

Try to use editable table widget or table record widget. Bind the record with a local variable (list data type of your entity where you want to store data entered by user).

In the preparation check weather the list ( use aggregate of an entity where you want to store data before if widget) is empty or not, if  it is empty assign the default values.

In this way whereever user lands in to the page, there is always one empty row to fill the data if the list is empty.

Give a button ( add a logic to create one more row just like you did in preparation) to append the record in the list (local variable).

Finally give a button  for final submit ( add a logic) to save the records in database. Use foreach loop and iterate the list ( local variable), store every record in database.

(Remember to add a filter in aggregate with id so that when you came back to check the form, existing data will be fetched)

Check the attached oml in the below discussion for reference.

https://www.outsystems.com/forums/discussion/53338/repeatable-forms/#Post199972

Hope it helps

Regards

Seema

Hi,

You could also consider to use the data gris forge component.

Regards,

Daniel

Daniël Kuhlmann wrote:

Hi,

You could also consider to use the data gris forge component.

Regards,

Daniel

Hi Daniel,

How this can accomplished by data grid?

I wanted to generate the columns and rows  based on input variables on the fly.

Thanks and Regards,


Seema Pandey wrote:

Fresher.Outsystems b wrote:

Hello All,

I have a requirement where i have a form and need to create a table based on the two input values as rows and column.

Columns names should also be auto-generated as variable1,variable2 etc. based on the input value wrt to the column.

Similarly with the row as row1, row2,etc based on the input value wrt to the row.

table rows should be editable.

After adding data i should be able to store the data to the database and when i open this form again then automatically table should be generated and value should be populated from database.


Canany one can help me on this?

Thanks in Advance,


Hi,

Try to use editable table widget or table record widget. Bind the record with a local variable (list data type of your entity where you want to store data entered by user).

In the preparation check weather the list ( use aggregate of an entity where you want to store data before if widget) is empty or not, if  it is empty assign the default values.

In this way whereever user lands in to the page, there is always one empty row to fill the data if the list is empty.

Give a button ( add a logic to create one more row just like you did in preparation) to append the record in the list (local variable).

Finally give a button  for final submit ( add a logic) to save the records in database. Use foreach loop and iterate the list ( local variable), store every record in database.

(Remember to add a filter in aggregate with id so that when you came back to check the form, existing data will be fetched)

Check the attached oml in the below discussion for reference.

https://www.outsystems.com/forums/discussion/53338/repeatable-forms/#Post199972

Hope it helps

Regards

Seema

Hi Seema,

Thank you for your input,

In my case table should display only after i give input variables(i.e., rows and column respectively) .

Initially my page should contains only two input widgets once i give values to it then it should generate table and user should be able to edit that table also save table data to the database.

if users opens the same page again then user should get the same data which he entered before.

Again he should be able to change the values in the table or also can change the input variable to regenerate the columns also rows with existing data 

example:

if user changed the value of column from 3 to 4 and row value from 4 to 5, then existing data should be as it is and additional should be blank and user should be able to add data into it.


Thanks and Regards