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).
- In InfoPath, select the group in to which you want to add the field (fields_output in this example)
- Right click the Group, and then click Add.
- 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.
- 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.
- In InfoPath, in the Fields section, right-click the field you want to delete, and then click Delete.
- Click Delete.
- 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.
- In InfoPath, highlight the field for which you want to set the value.
- Under Rules, click New (Tip: If the Rules section is not active, on the menu bar click Manage Rules).
- Click Action.
- 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.
- Click Add.
- Click Set a field's value.
- 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).
- On the Insert Formula screen, click Insert Field or Group.
- Select the field that you want the value to copy to the Field you selected in step 7, and then click OK.
- 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.
- In InfoPath, in the Fields Section, right-click the field for which you want to set a default value, and then click Properties.
- In the Field or Group Properties screen, do the following:
- Next to Value, click fx (the formula button).
- Click Insert Field or Group.
- Click the field you want the value to be, and then click OK.
- Click OK