Description
We are currently migrating from AEM Foundation Forms Components to AEM Core Forms Components. We have a URL query param which should be inserted in the submitted form data json. To achieve this I created a custom javascript function which I call from within the rule editor. In this function I then try to update the form data.
I have found a working solution after deep-diving into the source code:
var param = new URLSearchParams(window.location.search).get('....'); window.guideBridge.getFormModel().importData(Object.assign({}, window.guideBridge.getFormModel().getDataNode().$value, {afUnboundData: {data: {"param": param}}}) )
But this is far from straightforward. Is there a better way to achieve this? Normally there is, for example, the setData() function on guideBridge (I believe) but that doesn't work for core components. Is there a core components variant to easily add something to the json data?
Thanks!
Activity