Initialize Form Model based on CDM with custom data

Hi,
As a developer I would like to open a CFM form and initialize it with values (programatically).
When dealing with FMs I would create an activity using ActivityActions.create and pass initial data inside payload object ‘data’ property.
This is not working for me if I want to use a CFM form.

Can you point me to an example code or tutorial on how to do it?

Regards,
Grzegorz

Hi,
with CFMs, the data stored in the dataholder is not “just” the document like in the normal FM case. Instead, a more complicated structure is used (described in more detail here).

To set values inside that structure you could follow the approach outlined here and:

  • react on a “new” cfm activity
  • dispatch value changes for the fields you want to fill with initial values

Hi @g.witek,
has your question been answered or do you need further support? If it is answered, please, use the checkbox to mark the solution to your problem so that other users also know what helped in your case.
Thanks in advance!
Denise from the Discourse team