https://retellai.com/?utm_source=discord&utm_medium=seo logo
How can i setup a outbound voice agent which needs...
# ❓・ai-evy-support
s
@AI Evy How can i setup a outbound voice agent which needs to capture and provide two values as a variable in the transcript
a
Thanks for tagging me @sairam_09164. I'll look through relevant sources and get back to you shortly.
​ To learn more, see the sources I considered: [[1] How can I create an outbound call](https://retell.discourse.group/t/how-can-i-create-an-outbound-call/132) [[2] Register Phone Call](https://docs.retellai.com/api-references/register-phone-call) [[3] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[4] Here is how that can be fixed](https://retell.discourse.group/t/here-is-how-that-can-be-fixed/23) [[5] Extract Dynamic Variable Node](https://docs.retellai.com/build/conversation-flow/extract-dv-node) ​
### Answer To set up an outbound voice agent that captures two values as variables in the transcript, you'll need to use dynamic variables and the Create Phone Call API [(1) ]() . ## Creating the Outbound Call Use the Create Phone Call API with
retell_llm_dynamic_variables
to pass your two values [(2) ]() [(1) ]() :
Copy code
javascript
import Retell from 'retell-sdk';

const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;

const phoneCallResponse = await client.call.createPhoneCall({
 from_number: '+14157774444',
 to_number: '+12137774445',
}) ;
[(1) ]() ## Passing Dynamic Variables When creating the call, include your two values in the
retell_llm_dynamic_variables
field (all values must be strings) [(3) ]() [(1) ]() :
Copy code
javascript
{
  "from_number": "+16504144521",
  "to_number": "your_target_number",
  "override_agent_id": "agent_71724df7636716ceb3a7e244c8",
  "retell_llm_dynamic_variables": {
    "name": "Sarah"
  }
}
[(4) ]() ## Using Variables in Your Agent You can reference these variables in your agent's prompts using the
{{variable_name}}
syntax [(3) ]() :
Copy code
"Hello {{user_name}}, I understand you're interested in {{product_name}}. How can I help you today?"
Dynamic variables work in prompts, begin messages, tool configurations, and call handling . If you need to extract information during the conversation and store it as variables, you can use the Extract Dynamic Variable Node in Conversation Flow [(5) ]() . **
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.