https://retellai.com/?utm_source=discord&utm_medium=seo logo
How do I create a custom function that takes a var...
# ❓・ai-evy-support
d
@AI Evy How do I create a custom function that takes a variable in the url, not as a query parameter but as part of the main url ex. test.com/{{bookingUid}}/cancel
a
Thanks for tagging me @domtgr. I'll look through relevant sources and get back to you shortly.
### Answer You can include dynamic variables directly in the endpoint URL when creating a custom function [(1) ]() [(2) ]() . When configuring your custom function, add the dynamic variable in the endpoint URL field like this: ` The dynamic variables can be used in the endpoint URL field, and they work the same way as in other parts of the system [(3) ]() [(1) ]() [(2) ]() . Make sure the
bookingUid
variable is available as a dynamic variable in your call context [(3) ]() . According to the documentation, dynamic variables can be used in the tool call URL , and when you add the endpoint URL for your custom function, you can include dynamic variables directly in the URL path [(1) ]() [(2) ]() .
​ To learn more, see the sources I considered: [[1] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[2] Integrate any system with custom function](https://docs.retellai.com/build/single-multi-prompt/custom-function) [[3] 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.
d
@AI Evy how do I extract a response variable from a response that includes an array?
a
Thanks for the follow-up, @domtgr. I'll get back to you soon.
### Answer Based on the available sources, I don't have specific documentation about extracting response variables from arrays in Retell AI. The sources show basic response variable configuration where you assign the name without the
{{}}
and put the path of the variable in the value field [(1) ]() , but they don't provide examples or guidance for handling array responses specifically. The documentation shows simple JSON responses like:
Copy code
json
{
    "first_name": "Austin",
    "last_name": "Medina"
}
For array handling, you would likely need to use JSON path notation (like
array[0].property
or similar) , but the exact syntax for arrays isn't documented in the available sources. I'd recommend checking these potentially helpful sources: - [Extract Dynamic Variables]() - [Integrate any system with custom function]() Would you like me to try providing a general answer based on common JSON path practices, or would you prefer to contact support for specific array handling guidance? For direct support, you can: - Visit [Contact Sales]() - Visit [)
​ To learn more, see the sources I considered: [[1] Unable to get response variables working](https://discord.com/channels/1186424376300679209/1382730392813043833) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.