# Custom Workflow Action returns a JSON in HubSpot

**URL:** <https://community.hubspot.com/t/custom-workflow-action-returns-a-json-in-hubspot/116000>\
**Category:** APIs & Integrations\
**Tags:** workflows\
**Created:** [September 9, 2024, 12:38pm UTC](https://community.hubspot.com/t/custom-workflow-action-returns-a-json-in-hubspot/116000 "2024-09-09T12:38:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinib](https://avatars.discourse-cdn.com/v4/letter/v/d2c977/32.png) [@vinib](https://community.hubspot.com/u/vinib)\
**Post date:** [September 9, 2024, 12:38pm UTC](https://community.hubspot.com/t/custom-workflow-action-returns-a-json-in-hubspot/116000/1 "2024-09-09T12:38:38Z")

</div>

Hey HubSpot!

I’m working on a Custom Workflow Action that triggers an API call and returns a JSON response. The challenge I’m facing is that the structure of the JSON response isn’t static, so I can’t predefine the fields using the Definition API. Here’s the current output field definition I’m using:

```lia-code-sample
{
 "typeDefinition": {
 "name": "crew_result_raw",
 "type": "json",
 "fieldType": "text"
 },
 "supportedValueTypes": ["STATIC_VALUE"]
}

```

My goal is to extract specific values from this JSON (e.g., crew\_result\_raw[“my\_custom\_key”]) and use them in other workflow actions, like sending internal email notifications. However, I haven’t found a simple way to do this.

Is there a way to dynamically parse and reference values from this JSON field in other workflows? If not, could you suggest an alternative solution for achieving this?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![JessieS](https://avatars.discourse-cdn.com/v4/letter/j/b5e925/32.png) [@JessieS](https://community.hubspot.com/u/JessieS)\
**Post date:** [September 10, 2024, 6:16pm UTC](https://community.hubspot.com/t/custom-workflow-action-returns-a-json-in-hubspot/116000/2 "2024-09-10T18:16:01Z")

</div>

Hi @vinib!  
Good morning and thanks for reaching out! From my understanding, you’d like to apply JSON coding dynamically in a custom-coded workflow action to be able to use values pulled in with the code when sending internal email notifications in a workflow. Is that correct?  
Had you tried implementing [branches](https://knowledge.hubspot.com/workflows/use-if-then-branches-in-workflows) for conditional logic in the workflow and adding [personalization tokens](https://knowledge.hubspot.com/website-pages/personalize-your-content) in the internal email action(s)?  
Would you be able to share a screenshot of your workflow actions and another of that specific action so we have additional context?  
This doesn’t look to be a default functionality that’s supported, but I found this other post that seems to get at a similar goal to yours in case you find it helpful: [https://community.hubspot.com/t5/APIs-Integrations/how-to-create-dinamyc-inputs-in-my-custom-action/td-p/1000774](https://community.hubspot.com/t5/APIs-Integrations/how-to-create-dinamyc-inputs-in-my-custom-action/td-p/1000774)  
Tagging in HubSpot subject matter experts @Humashankar , [@Danielle\_J](https://community.hubspot.com/t5/user/viewprofilepage/user-id/673740) , [@Jaycee\_Lewis](https://community.hubspot.com/t5/user/viewprofilepage/user-id/127074) in case they have further insight. Any thoughts?

Thank you and have a great day!  
Best,  
Jessie  
HubSpot Community Moderator

---

<div class="post-metadata">

**Author:** ![Humashankar](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/humashankar/32/30856_2.png) [@Humashankar](https://community.hubspot.com/u/Humashankar)\
**Post date:** [September 10, 2024, 9:37pm UTC](https://community.hubspot.com/t/custom-workflow-action-returns-a-json-in-hubspot/116000/3 "2024-09-10T21:37:33Z")

</div>

Hi @vinib

If you have JavaScript expertise, you can utilize HubSpot’s Custom Code Actions to craft a script that interprets the JSON response, extracts the required values, and stores them in a custom HubSpot property or utilizes them directly in your workflow actions.

Though, if your JSON structure is complex and varied, consider developing a middleware service to handle advanced parsing.

This service can process the JSON externally, extract specific values, and return them to HubSpot via a webhook, enabling their use in your workflow.

**Hope this helps - Happy to help further!!**  
**Thank you very much and have a great one!**  
**Warm regards**

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [September 11, 2024, 5:06pm UTC](https://community.hubspot.com/t/custom-workflow-action-returns-a-json-in-hubspot/116000/4 "2024-09-11T17:06:48Z")

</div>

Thanks @Humashankar 🙌 — Jaycee
