Prefilling questions with case details
Sometimes it may be useful to pre-populate questions in a form with data contained in a corresponding case in Jadu CXM.
It is possible to do this using two advanced features of XFP, Logic and Prefills.
Example: Prefilling a Payment Method dropdown from a CXM case
We have created a form in XFP for renewing a subscription, and it has a question called Payment Method, which offers 'Card' or 'Direct Debit'.
The subscription in question is managed by a CXM case, which has a 'Payment Method' field. At the beginning of the XFP form, we ask the customer for their case reference.
We can use a combination of prefills and logic to default the Payment Method question to match what's already stored in the case.
Step 1: Create a logic formula
In your form, click Advanced > Logic in the top navigation bar (under the the form title).
Click Add Logic.
You will be taken to the logic designer, where you can build your logic.
Give your logic a name, 'Case Payment Method'.
Choose Predefined as the type.
Choose CXM - Value of field for a specific case from the appearing list.
Set the inputs to the formula. CXM Case Reference will be our case reference form question. CXM Field will be the 'Payment Method' case field. Leave Run as signed in user set to 'Yes'/
Click Save to create the logic.
Step 2: Use the logic to prefill the question
In your form, click Advanced > Prefills in the top navigation bar (under the the form title).
Click Add Prefill.
The create interface will open.
Choose the question to prefill, Payment Method and the where the prefill value should come from, Logic - Case Payment Method.
The prefill will be created.
Test the form - you will see the Payment Method question defaults to the value stored in the case.