Custom Value/Field Arrays: Suggestion on Syntax and Functionality
D
Doug Richardson
I realize this might be an idea from a few other posts however I would like to suggest how this might work to generalize functionality for some of these Ideas.
## Related Posts:
"Forgive me for not posting all of these"
## Functionality Description:
Array Field/Value Description and UI
: Take the Checkbox Custom Field (minus the "Object" Assignment for Custom Values) and require a DEFAULT Option as well as the ability to Add More Options. Option Name and Option Value MUST be allowed to be different. For Custom Fields we can Replace the Option Value with an Option Validation field (i.e. A Dropdown with typical validation types such as STRING, BOOL, URL, EMAIL, REGEX???? maybe an idea for the future.)Should Custom Fields be Mutable?
: The issue GHL has with doing this for Custom Fields is that Mutability of the Array Keys is not possible. I prompted Grok 3 for a brief explanation
: "Mutability of standard array keys for a database field can cause issues because it risks breaking consistency and integrity in data retrieval and storage. If keys are altered dynamically, queries or application logic relying on specific key names may fail, leading to errors or unpredictable behavior. It also complicates data validation, schema mapping, and debugging, as the expected structure becomes unreliable across different parts of the system." Forgive me if I am using the wrong terminology to describe the software (mutability vs immutability).In theory, for Custom Fields, Options MUST BE IMMUTABLE AFTER SUBMISSION. The only exception that could be allowed for a deletion of an option. This SHOULD come with a warning and delete this field from every contact in the database.
How to call this in workflows/email templates/etc
:EXAMPLES: We will be using a typical merge tag and array syntax. Since we have a default field, any value can be set for the key:
{{ contact.custom_array[1] }}
{{ custom_value.message_option[1] }}
{{ custom_value.colors["Primary"] }}
Allow for a SECOND field/value to become the array key
{{ contact.custom_array[inboundWebhookRequest.foobar]}}
Updating through Workflows
:Options MUST be Updated via each specific KEY. When you click to update an option that is an array , you will then be given the options to select the specific KEY you would like to Update, Add, Clear, etc.
Log In