https://retellai.com/?utm_source=discord&utm_medium=seo logo
If a custom tool call response has a array of obje...
# ❓・ai-evy-support
d
@AI Evy If a custom tool call response has a array of object in it, How do I store extract a variable from the object? Lets say array[0].variable1 ?
a
Thanks for tagging me @dyshah46. I'll look through relevant sources and get back to you shortly.
### Answer You can extract values from a custom function response using the Store Fields as Variables feature. [(1) ]() When configuring your custom function, you specify: - **Variable Name**: The name you want to use (e.g.,
variable1
) - **JSON Path**: The path to the value in the response (e.g.,
array[0].variable1
) This extracts the value and saves it as a dynamic variable that you can reference later using
{{variable1}}
. For example, if your custom function returns:
Copy code
json
{
  "array": [
    {
      "variable1": "some_value",
      "variable2": "another_value"
    }
  ]
}
You would set: - Variable Name:
variable1
- JSON Path:
array[0].variable1
The extracted value would then be available as
{{variable1}}
throughout your conversation flow. [(2) ]() [(1) ]()
​ To learn more, see the sources I considered: [[1] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[2] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.