Hi Team,
I want to display the single row of array data into multiple rows in read only grid. pls find the below screenshot.
one invoice reference number multiple order items in database, but i want to display one invc numer and one order item 1 row. Again, same invc number second value vale of order item number 2 different row. pls refers first row data.
Thanks,
Nagesh
Discussion posts and replies are publicly visible
Better to user Bulleted List For View and Space Optimization Based on Unique Key.
a!localVariables( local!data: { a!map( invoice: 12345, itemId: { 1, 22, 31, 12 }, billedQuantity: { 1, 2, 1, 1 } ), a!map( invoice: 67890, itemId: { 41, 51, 22 }, billedQuantity: { 1, 2, 1 } ) }, local!formatData: a!flatten( a!forEach( items: local!data, expression: a!localVariables( local!rowData: fv!item, a!forEach( items: fv!item.itemId, expression: a!map( invoice: local!rowData.invoice, itemId: fv!item, billedQuantity: index( local!rowData.billedQuantity, wherecontains(fv!item, local!rowData.itemId), null ) ) ) ) ) ), { a!gridField( label: "Original Data", data: local!data, columns: { a!gridColumn(label: "Invoice", value: fv!row.invoice), a!gridColumn(label: "Item Id", value: fv!row.itemId), a!gridColumn( label: "Billed Quantity", value: fv!row.billedQuantity ) } ), a!gridField( label: "Formatted Data", data: local!formatData, columns: { a!gridColumn(label: "Invoice", value: fv!row.invoice), a!gridColumn(label: "Item Id", value: fv!row.itemId), a!gridColumn( label: "Billed Quantity", value: fv!row.billedQuantity ) } ) } )