You are here: Tutorials & Examples > Solution Accelerators > Same fields with multiple scripts

Form Design Notes - Same fields, multiple scripts

How to manually add a field to a form

To add a field in InfoPath that was not automatically generated from Designer, do the following:

Note: If you used the Use existing fields option for a script but need a unique log field, you will need to add a unique log field name and remap your script accordingly. To do this open InfoPath and under the fields section (panel on the right hand side of the screen).

  1. In InfoPath, select the group in to which you want to add the field (fields_output in this example)
  2. Right click the Group, and then click Add.
  3. In the Add field or Group dialog box, enter the following:
    • Name: Type a unique field name
    • Type: Select Field (element) for a new field, and use Group for a new group
    • Data Type: Select the appropriate data type from the list.
  4. Click OK

How to delete a field not used for a web service

If a field is generated from Designer but not used anywhere in the form you can delete the field. If it is unknown if a field might be used it is best to leave the field in the form and not delete it.

  1. In InfoPath, in the Fields section, right-click the field you want to delete, and then click Delete.
  2. Click Delete.
  3. Click Yes.

How to use a rule to set a value of one field equal to another

In order to keep different form fields in sync, create a rule to set the value of another field.

This option enables the user to overwrite or change a field's value if needed.

  1. In InfoPath, highlight the field for which you want to set the value.
  2. Under Rules, click New (Tip: If the Rules section is not active, on the menu bar click Manage Rules).
  3. Click Action.
  4. On the Rules screen, enter the following information:
    • Details for: Enter the name of the rule and/or change the name of the rule to something meaningful (user friendly).
    • Condition: Set a condition for when you want to set the value of the field. In this case, it is usually set for when the field is not blank.
  5. Click Add.
  6. Click Set a field's value.
  7. On the Rule Details screen, enter the following information:
    • Field: The field for which you are setting the value
    • Value: Click fx (the formula button).

  8. On the Insert Formula screen, click Insert Field or Group.

  9. Select the field that you want the value to copy to the Field you selected in step 7, and then click OK.
  10. Click OK.

How to use a default value to set a value of one field equal to another

In order to keep different form fields in sync or equal to another field, set the default value to another field's value. This option does not allow the user of the form to edit or change the field's value.

  1. In InfoPath, in the Fields Section, right-click the field for which you want to set a default value, and then click Properties.
  2. In the Field or Group Properties screen, do the following:
  3. Next to Value, click fx (the formula button).

  4. Click Insert Field or Group.

  5. Click the field you want the value to be, and then click OK.
  6. Click OK