FormProcessorAction mappings don't handle deleted values or fields
When you delete an input specified in a parameter for a multi-valued field, it remains part of the mapping, and that form processor will always throw an error. The only solution is to manually edit the JSON in the database.
Steps to Replicate
- Create a new form processor with two integer inputs named "contact 1", "contact 2".
- Add an action with a multi-value parameter (e.g. "Create Activity").
- Add contact 1 and 2 as inputs to the "Target Contact" parameter.
- Delete contact 1.
- Open the action. Note that only contact 2 is now visible.
- Save the action.
Expected Result
Since only contact 2 is visible in the field, only contact 2 should be saved.
Actual Result
Contact 1 is still present. Adding or removing additional inputs will not change this.
Secondary related issue
Deleting a custom field from a custom field group doesn't delete it from a mapping. To replicate, create a custom field group with two fields, "Field 1" and "Field 2". Create a form in Form Processor, and include an action that references this custom field group (e.g. "Create Activity" if they're activity custom fields. Map inputs to both fields and save
Now delete Field 2. This Form Processor is now broken, and resaving the action doesn't remove Field 2 from the mapping.
I'll try to find a fix.