Possible to "Prefill" an Umbraco Forms FieldMapper?

Hey all,

Just wondering, has anyone found a way (Or know if its possible) in a custom forms workflow to prefill a setting that has been marked as a FieldMapper?

I.E, I know for example what Aliases should exist from a backoffice perspective, when a user adds the workflow, I would only want them to select the appropriate form fields via the dropdowns.

In older situations, we have ended up just creating a custom form field to do this, but would be great to learn if this is possible out of the box nowadays!

Hi,

If I understood your doubt correctly, I don’t think there is a built-in way to prefill or control the default values of the FieldMapper in Umbraco Forms.

Instead, what I would do is build my own mapping UI by using:

  • a custom field type / custom setting editor attached to the workflow
  • a button that loads the fields of the current form from the database (or a pre-populate)
  • a manual mapping table where the user can map form fields

This gives you full control: the user sees exactly which aliases need to be mapped and only has to pick the corresponding form fields. During the workflow execution, you just deserialize the JSON and map the values programmatically.

Hope this helps!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.