This guide will demonstrate how to automatically populate a field in your Formyoula form using the “Field Value Replace” field. We will use an example where a “Product Code” selection automatically updates the “Discount in %” field.
This logic also works when using prefill, for example, if the Product Code is prefilled from Salesforce, the “Discount in %” will still be updated automatically.
1. INITIAL SETUP:
- Drag and drop a “Select”, a “Text”, and a “Field Value Replace” field inside a “Repeat” field onto your form as shown below.
- Rename the fields as needed.
2. CONFIGURE THE “SELECT” FIELD:
- Click the pencil icon of the “Select” field.
- Add product codes.
3. CONFIGURE THE “FIELD VALUE REPLACE” FIELD:
- Click the pencil icon on the “Field Value Replace” field.
- Set “From Field”: Select the “Product Code” field from the dropdown.
- Set “To Field”: Select the “Discount in %” field from the dropdown.
- Under the “From/To Map” section, add the following pairs:
- Set “From Value” to
LA001
and “To Value” to05
- Set “From Value” to
LA002
and “To Value” to10
- Set “From Value” to
LA003
and “To Value” to15
- This configuration means:
- When the user selects
LA001
in the “Product Code” field, the “Discount in %” field will automatically be filled with05
. - If the user selects
LA002
, the discount will be updated to10
. - If the selection is
LA003
, the discount will be set to15
.
- Save the changes.
4. TEST YOUR FORM:
- Try your form.
- Select a “Product Code” from the dropdown.
- The corresponding “Discount in %” field value will be updated automatically based on the mapping.
Example Form.json4.7 KB
For any questions, please contact us - [email protected] or the Formyoula in-app chat. 🙂