Looping All Record and field in table outsystems

Hi All,


I have a table, and i want to looping all data inside the table and store to new table with 1 field,

Let say i have student_table, and field is Name, Age, Address

student_table have 5 record.

And i want to get all 5 record and save to new table, let say student_final.

and table student_final just have 1 filed, lets say body_field.


Example:

student_table
|Name | Age |Address|

| A | 10 | 6 Street |

| B | 10 | 6 Street |

| C | 10 | 6 Street |

| D | 10 | 6 Street |

| E | 10 | 6 Street |


Store to new Table

student_final

| Body_Field |

| A10 6 Street |

| B106 Street |

| C106 Street |

| D106 Street |

| E106 Street |



Thanks

mvp_badge
MVP
Solution

Hi Kane,


You can do that very easily, in a few steps:

  1. Query the students table
  2. For each student
  3. Create a record in student_final with the Body_Field as the concatenation of the student_final attributes

Something like the image below:


Kind Regards,
João

Hi João


Thanks for your answer, but that just save 1 record in student_final


Thanks,

Kane

mvp_badge
MVP

It will create as many records as the list it is looping.

Check your query / table you are looping to see if you don't have the max records set to 1 or a filter to make it only one record.

Hi Kane,

I hope you are doing well!!

Please take reference of this one,

https://www.outsystems.com/forums/discussion/55628/create-columns-with-names-in-row-values-of-a-related-entity/

Make a nice day!!

Kind regards,

Ajit Kurane.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.