https://retellai.com/?utm_source=discord&utm_medium=seo logo
I've using the Extract Dynamic Variable function i...
# ❓・ai-evy-support
k
@AI Evy I've using the Extract Dynamic Variable function in a single prompt agent, but it is not extracting the variable, which is the return value of another function call.
a
Thanks for tagging me @kevinstonepdx. I'll look through relevant sources and get back to you shortly.
### Answer The issue you're experiencing is likely due to the order of execution. The Extract Dynamic Variable function needs to run before the function that uses the extracted variable [(1) ]() . Based on similar cases, ensure that: 1. The Extract Dynamic Variable function is explicitly called first in your prompt instructions 2. You're referencing the variable by its name directly (e.g.,
{{variable_name}}
) rather than using dot notation like
extraction_node.variable_name
[(2) ]() In your prompt, explicitly instruct when to call the extract function. For example [(3) ]() :
Copy code
When user provides [the information], please call the `extract_variable_name` function first.
After extraction completes, the variable should be available for use in subsequent function calls [(1) ]() . If the variable still isn't populating, verify in your call history that the extraction function is actually being invoked before the function that needs the variable . **
​ To learn more, see the sources I considered: [[1] Got an issue passing a dynamic variable from Speech to query parameters for GET Request](https://discord.com/channels/1186424376300679209/1419690928578232431) [[2] Extracted Dynamic Variables not sending through custom function in Conversation Flow Prompt](https://discord.com/channels/1186424376300679209/1442542149546803312) [[3] MCP](https://docs.retellai.com/build/single-multi-prompt/mcp) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.