Insert data into SharePoint list using invoke FDM workflow step

This article explains the steps required to insert data into SharePoint list using the invoke FDM step in AEM workflow.

This article assumes you have successfully configured adaptive form to submit data to SharePoint list.

Create a form data model based on the SharePoint list data source

  • Create a new form data model based on the SharePoint list data source.
  • Add the appropriate model and the get service of the form data model.
  • Configure the insert service to insert the top level model object.
  • Test the insert service.

Create a workflow

  • Create a simple workflow with invoke FDM step.
  • Configure the invoke FDM step to use the form data model created in the previous step.
  • associate-fdm

Adaptive Form based on core components

The submitted data is in the following format. We need to extract the ContactUS object using dot notation in the invoke Form Data Model Service workflow step as shown in the screenshot

{
  "ContactUS": {
    "Title": "Mr",
    "Products": "Photoshop",
    "HighNetWorth": "1",
    "SubmitterName": "John Does"
  }
}
  • map-input-parameters

Adaptive Form based on foundation components

The submitted data is in the following format. Extract the ContactUS JSON object using the dot notation in the invoke Form Data Model Service workflow step

{
    "afData": {
        "afUnboundData": {
            "data": {}
        },
        "afBoundData": {
            "data": {
                "ContactUS": {
                    "Title": "Lord",
                    "HighNetWorth": "true",
                    "SubmitterName": "John Doe",
                    "Products": "Forms"
                }
            }
        },
        "afSubmissionInfo": {
            "lastFocusItem": "guide[0].guide1[0].guideRootPanel[0].afJsonSchemaRoot[0]",
            "stateOverrides": {},
            "signers": {},
            "afPath": "/content/dam/formsanddocuments/foundationform",
            "afSubmissionTime": "20240517100126"
        }
    }
}

foundation-based-form

Configure Adaptive Form to trigger AEM workflow

  • Create Adaptive Form using the Form Data Model created in the earlier step.
  • Drag and drop some fields from the data source onto your form.
  • Configure the submit action of the form as shown below
  • submit-action

Test the form

Preview the form created in the previous step. Fill out the form and submit. The data from the form should get inserted into the SharePoint list.

recommendation-more-help
4859a77c-7971-4ac9-8f5c-4260823c6f69