Hi, I am building a page where I need to show the list products available in my database in a particular interface. It's like a product inventory. Is there any object to show repetitive dynamic layout which will display a specific section repeatedly for the number of products available in my database.
Discussion posts and replies are publicly visible
Hello Mayurimestry,You can simply write your expression in a!forEach(). In the Items add your product data and in the expression configure your section/card of how you are planning to display the data.
a!localVariables( local!products: rule!XXX_QR_getProductXXXDetails(isActive: true), { a!forEach( items: local!products, expression: { /*Create and expression rule for this and call it here instead of having the whole code*/ a!cardLayout( shape: "ROUNDED", padding: "MORE", marginBelow: "STANDARD", contents: { a!sectionLayout( label: concat( fv!index, ". ", fv!item['recordType!{2b924bf1-5a42-XXX}XXX PCCoot XXX Detail.fields.{eb4513cb-275e-4a41-b750-XXXX}productName'] ), divider: "ABOVE", contents: { a!columnsLayout( columns: { a!columnLayout( contents: { a!textField( label: "SKU Code", value: fv!item['recordType!{2b924bf1-5a42-XXX}XXX PCCoot XXX Detail.fields.{eb4513cb-275e-4a41-b750-XXXX}productSKU'], readOnly: true ), a!paragraphField( label: "Description", value: fv!item['recordType!{2b924bf1-5a42-XXX}XXX PCCoot XXX Detail.fields.{eb4513cb-275e-4a41-b750-XXXX}productDescription'], readOnly: true ) } ), a!columnLayout( contents: { a!imageField( size: "LARGE", images: a!documentImage( document: fv!item['recordType!{2b924bf1-5a42-XXX}XXX PCCoot XXX Detail.fields.{eb4513cb-275e-4a41-b750-XXXX}image'] ) ) } ) } ) } ) } ) } ) } )
I would suggest making a dedicated interface for showing the details of the items and then you can even call the entire interface in your expression using 'rule!'
Repetition is achieved using forEach() function, it iterates to the list of items and do the processing for each item. The list of items cab be pulled from the DB or any other source and can be provided to forEach() for processing.
Thank You Konduru Chaitanya. This is what I was looking for.
Thank you Abhay Dalsaniya
Mayurimestry Thanks for confirming what you were looking for & If you are willing please hit 'Verify answer'.