Convert ACS Generic List into JSON/Array and then Inject JSON/Array into Page
Hi All,
I have a requirement to access the list stored in ACS Commons Generic List, then convert that list into JSON/Array in the backend and inject that JSON/Array into the page (most likely into customheaderlibs). I want to store JSON/Array in the JavaScript variable on the page. Some of the components on the page will use this list to run some business logic.
<script>
// If Array
window.genericList = [${genericListComingFromACSCommons}];
// OR
// If JSON
window.genericList = JSON.parse(${genericListComingFromACSCommons});
</script>
Added code for clarification only. I have no idea how I will be able to bind the data at a page level. I tried looking this up over the internet but haven't found anything close to what I am looking for.
Any suggestion or idea on implementing this whole setup would be helpful.
Thank you!