Articles in this section

FAQ: How to set up prefill of metadata from context and activity to a form

Published:
Updated:

Prefill copies metadata values from an activity, or from the context that activity belongs to, into the fields of a form, so the person filling in the form does not have to retype what the system already knows.

All prefill runs through an activity: the activity carries the metadata, and it prefills one or more forms. Setting it up means preparing the form and the activity template so their IDs match, then pasting a generated prefill code into the form.

Prepare the Form in the Designer

For prefill to work, the form element must have the correct Element ID.

  1. Change the Element ID for each field that should be prefilled.
  2. The Element ID should be easy to recognize.

Example:

  • A field that shows the customer name should have the Element ID: customername

Skjermbilde_2026-06-30_kl_081312.png

When all fields that need prefill have the correct Element IDs, save the form.

Prepare the Activity Template

When the form is ready for prefill, add one or more metadata fields to the activity template.

When you enter a Display Name for a metadata field, a Metadata ID is created automatically.

The ID will start with meta. followed by the generated name. The ID must match the Element ID used in the form designer.

Example:

  • Display Name: Customer Name
  • Metadata ID: meta.customername

Skjermbilde_2026-06-30_kl_082618.png

After a metadata field has been added to an activity template and saved, its ID cannot be changed. Because of this, make sure the Display Name matches the Element ID from the designer when you create it. The Display Name can be changed later if needed.

Check the Form Mapping

Open the Forms tab in the activity template.

You will see that the metadata field has been mapped automatically. This happens when the metadata field is added to the activity.

CleanShot_2026-06-30_at_082732.gif

Add the Prefill Code to the Form

After all metadata fields have been added and the Metadata IDs match the Element IDs in the form, click Copy Prefill Code.

Copy the generated code.

CleanShot_2026-06-30_at_082929.gif

Next:

  1. Open the form you want to prefill in the designer.
  2. Select the main form element.
  3. Open the Other tab.
  4. Enable Prefill form with data.
  5. Paste the prefill code you copied.

CleanShot_2026-06-30_at_083058.gif

Save and close the form, then return to the activity template.

The prefill code must be added to every form that should be prefilled.

Create an Activity and Test the Prefill

When this setup is complete, you can close the activity template.

Prefill now works automatically. Create an activity, enter a value in the metadata field, then create a new entry from it: the value appears in the matching form field without anyone typing it. If it does not, the Element ID and the Metadata ID do not match, or Prefill form with data is not enabled on the form's main element.

Prefill from Context

Context prefill is also configured through the activity.

You do not need to create the same metadata field on both the activity and the context. The field only needs to exist on the context.

To set up prefill from a context, you must first add the form that will be prefilled to the activity. This allows the system to identify which metadata field in the form should be mapped to the context.

In the activity template:

  1. Open the Forms tab.
  2. Go to Advanced Form Setup.

Here you will see all metadata fields that have been created for the activity.

Click Add Mapping at the bottom of the list.

A list of all form elements will appear, together with the form template each element belongs to.

Select the element that should be mapped to the context.

After adding the mapping, only the Element ID will be shown

CleanShot_2026-06-30_at_083503.gif

Next:

Change the fields Meta ID so it starts with contextMeta.

Example:

  • serviceinfo → contextMeta.serviceinfo

Copy the new prefill code and paste it into the form template.

When an activity is created from a context that contains the mapped metadata field, the value will automatically be prefilled into the form.

If an activity is created without a context that contains the mapped metadata field, the prefill will simply not occur. The activity and form will still work normally.

Context data must pass through the activity before it can be added to the form.

Because of this, you must:

  1. Add the form template to the activity.
  2. Map the form field as a metadata field.
  3. Mark that metadata field as coming from the context by changing its ID to contextMeta..

Once these steps are complete, the context data will be passed through the activity and automatically prefill the form. :::

FAQs

Can I change a Metadata ID after saving?
No. Once a metadata field has been added to an activity template and saved, its ID cannot be changed. Make sure the Display Name produces the right ID when you create the field. The Display Name itself can be changed later, and to get a different ID you have to add a new metadata field.

Do I need to create the same metadata field on both the context and the activity?
No. The field only needs to exist on the context. The form still has to be added to the activity and the field mapped there, with its Meta ID changed to start with contextMeta., because context data has to pass through the activity before it reaches the form.

What happens if an activity is created without a context?
The prefill simply does not occur. The activity and the form still work normally, so a missing context is not an error.

Does one prefill code cover every form in the activity?
No. The prefill code must be pasted into every form that should be prefilled. Adding it to one form does not prefill the others.

Nothing is prefilled. What should I check first?
Three things, in this order: the Element ID in the form designer matches the Metadata ID on the activity template (meta.customername matches customername), Prefill form with data is enabled on the form's main element under the Other tab, and the current prefill code has been pasted into that form after the last metadata change.

Was this article useful?
yes
No
Help us improve this page
Please provide feedback or comments
Access denied
Access denied