Question
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1690008000/6e91ea19-04b7-48d3-92a5-81a4c856cb82.jpg?itok=XCQHtc1j)
AreteansTech
AU
Last activity: 31 Aug 2022 6:44 EDT
Save value in page-list from a non auto-generated HTML
Hi all,
I'm working on a POC that involves dynamically populating a UI, where the label and input type are sourced from a page list, and the user input needs to be saved in the list on Submit.
JSON payload that is converted to a pagelist:
[ { "FieldName": "First name", "FieldType": "text" }, { "FieldName": "Last name", "FieldType": "text" }, { "FieldName": "Post code", "FieldType": "number" } ]
The non auto-generated UI code:
<pega:forEach name="pyWorkPage.FieldList"> <label><pega:reference name="$this.FieldName" /></label><br> <input type="<pega:reference name="$this.FieldType" />"><br> </pega:forEach>
This works fine, and the UI is populated as expected.
Now I need to save the user input against each element in the list. I.e.: If the user enters "John" as his first name, the value "John" should be saved in pyWorkPage.FieldList(1).FieldValue
Appreciate any input on how this can be achieved.
Thanks in advance.
Lahiru.
***Edited by Moderator Marije to add Capability tags***