Skip to content

Info request: how to update submitted form data? #1527

Open
@GeetsM

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions