List all vales from an array in a table/expression
Application Type
Traditional Web

I have table records fetcing data. The structure of the data has alist for a value that is being populated, however when it gets added to the table, only the first item in the list is dispplayed. 

How do I show all items in the list in the one column of the table.

Thank you

mvp_badge
MVP

Hi Yats,


Create a block that receives the list attribute and renders this list attribute in a list itself.

Now you should have that block in your table cell rather than an expression. Having a block it's the way of having a list inside a list.


Kind Regards,
João

mvp_badge
MVP

I haven't mentioned aggregate.

If I understood your needs correctly, you have a structure where one of the attributes is a list and you want to display all its values in each of the table cell of that column, right?


If that is the case, you should have a structure like in the example below, where you want to display a list of OriginalObjects and one of the attributes is a list of SubObject:


In my example, OriginalObject would be mapping to a table records with two columns:

  • One column Name, with the expression showing the field Name;
  • A second column called SubObject filled with a block. This block receives a Subobject list, and displays a list with each of the names of that SubObject List.


João Marques is right. You can use block and render another list in one of your list column. if you are receiving data from API, you can create a structure and deserialize your array to that structure with same attributes. That list you can pass to the block.

Example: if you are receiving data as {data:[{"name":"some value"},{"name":"some value"},{"name":"some value"}]}

you can create a structure with attribute name and then create a local variable of type list of that structure and deserialize your json using that local variable.

Pass the same local variable to your block to render the list.

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