Set Field Values Dynamically Using The Field Value Replace Field

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.
image

2. CONFIGURE THE “SELECT” FIELD:

  • Click the pencil icon of the “Select field.
  • Add product codes.
image

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.
image
  • Under the “From/To Map” section, add the following pairs:
    • Set “From Value” to LA001 and “To Value” to 05
    • Set “From Value” to LA002 and “To Value” to 10
    • Set “From Value” to LA003 and “To Value” to 15
  • This configuration means:
    • When the user selects LA001 in the “Product Code” field, the “Discount in %” field will automatically be filled with 05.
    • If the user selects LA002, the discount will be updated to 10.
    • If the selection is LA003, the discount will be set to 15.
image
  • 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.
image
Example Form.json4.7 KB

For any questions, please contact us - [email protected] or the Formyoula in-app chat. 🙂