I'm verifying a country as a string is allowed in our other country field (drop down) before I attempt to write it. This is to support the logic applied in salesforce to pass a lead to the right sales queue. My script fetches the property options from the schema API. I would like to avoid making a second API call to update the property due to the high volume that can go through this workflow.
My enumeration drop down is a list of countries. It is super long and I want to avoid configuring this in the interface especially as it changes from time to time.
I understand the difference in the data types. Is there anything I can do in the code to set the enumeration in the output so that I can update the property in a standard workflow action? e.g. output the integer of the displayorder... would that work?
Hey @OJ_ONT👋 Thanks for your post. I think you are on the right track.
I'd suggest using Postman to see the list of options for your dropdown property and identify the difference between the visible label and the required internalValue.
"options": [
{
"label": "United States",
"value": "united_states", // <-- This is the value you need to find and use
"displayOrder": 2
},
{
"label": "Mexico",
"value": "mexico", // <-- This is the value you need to find and use
"displayOrder": 1
}
]
You will find the options array. The label is the text you see in HubSpot, and the value is the internal name you need to use.
Then you can look into a Custom Coded Workflow Action to make the same request and loop through the list of options from the API response and find the one where the label matches your input string.
Basically, from the single option that matches, extract the value (e.g., united_states) and then the action should output that extracted value.
I'd either post back here or start a new post once you have your custom coded action set up so our community members can give you more specific feedback.
Have fun testing! — Jaycee
HubSpot’s AI-powered customer agent resolves up to 50% of customer queries instantly, with some customers reaching up to 90% resolution rates.
Ahhhh... ok. I feel foolish, but also a little misled by the user interface. I thought I had to define the options for the enumeration in the UI (using the 'Enumeration options' text box). In the case of countries that could mean manually typing in >190 country names.
In reality I can just select enumeration and give it a name and then output to the variable.
So ... the obvious next question is: what is the use case for the box for entering the Enumeration options?
Hey @OJ_ONT👋 Thanks for your post. I think you are on the right track.
I'd suggest using Postman to see the list of options for your dropdown property and identify the difference between the visible label and the required internalValue.
"options": [
{
"label": "United States",
"value": "united_states", // <-- This is the value you need to find and use
"displayOrder": 2
},
{
"label": "Mexico",
"value": "mexico", // <-- This is the value you need to find and use
"displayOrder": 1
}
]
You will find the options array. The label is the text you see in HubSpot, and the value is the internal name you need to use.
Then you can look into a Custom Coded Workflow Action to make the same request and loop through the list of options from the API response and find the one where the label matches your input string.
Basically, from the single option that matches, extract the value (e.g., united_states) and then the action should output that extracted value.
I'd either post back here or start a new post once you have your custom coded action set up so our community members can give you more specific feedback.
Have fun testing! — Jaycee
HubSpot’s AI-powered customer agent resolves up to 50% of customer queries instantly, with some customers reaching up to 90% resolution rates.
Ahhhh... ok. I feel foolish, but also a little misled by the user interface. I thought I had to define the options for the enumeration in the UI (using the 'Enumeration options' text box). In the case of countries that could mean manually typing in >190 country names.
In reality I can just select enumeration and give it a name and then output to the variable.
So ... the obvious next question is: what is the use case for the box for entering the Enumeration options?