Can data from multiple fields be consolidated into a single field?

We use Gravity to take charitable gifts for a non-profit. We export entry data from Gravity & import it into our CRM to process these gifts. One of the things we collect is the fund, e.g., where someone’s gift should be applied. There are 3 possible fields we use to collect that info from a donor:

  1. a hidden free-text field that we pre-fill via a URL string
  2. a dropdown menu of funds with IDs stored as values
  3. an “other designation” free-text field where a donor can name their own fund

Data will be recorded in either 1, 2, or a combination of 2 and 3 above – the other designation field only shows when the dropdown menu option is set to “other”.

The problem we have is that there’s a single field in our CRM where the fund data goes. Is there a way to use merge fields to consolidate the data from the 3 fields above into a single field that can be mapped into our CRM? Any thoughts/insights would be appreciated.

Thanks!

Hello @hmoulis. You can use the PHP filter gform_pre_submission to combine the data from all three fields into 1 field. It would be somewhat like example 2 here:

You will concatenate all three fields, or perform some check to see which fields contain data, then combine, then assign back to a hidden field in the form. Then the data in that field is what you send to your CRM. If you have any other questions, please let us know.

The gform_replace_merge_tags filter also provides a number of good examples of how to create your own merge tags so that could be used in other places (like notifications) too.

Depending on how you integrate to your CRM to pass that data, using the Gravity Flow Outgoing Webhook Step might be able to give you a no-code approach as well - using conditional logic as to which step(s) in the workflow to fire and/or how the data should be mapped in the request/response object.