Block output variable issue
# support
v
Hello, Im new with using Vapi, and just discovered cool Blocks feature, but I`m stuck with passing variable from parent block and send it to external endpoint using tool feature, in my code it gives me { mc_number: '{{mc_verification.output.mc_number}}' } inside body.message.toolCalls[0].function.arguments instead of actual input, can you help me with that ?
v
@vaniacrunch Hello! I'm glad to hear you're exploring the Blocks feature in VAPI. It sounds like you're trying to pass a variable from a parent block to a tool call, but it's not resolving correctly. To help you effectively, I'll need a bit more information about how you're structuring your Blocks and the specific code you're using to pass the variable. Could you please provide me with the relevant portion of your code or the steps you're taking to set up the variable passing? This will allow me to give you more accurate guidance on how to resolve the issue.
You can continue this conversation by mentioning me in the message.
already tried without braces, and pass it via JSON input instead of fields, same result
variable itself shows up in request body, but value has same content as vapi variable name
@Vapi
v
@vaniacrunch It seems like there might be an issue with the way the variable is being referenced or interpolated in your tool call. When you're using VAPI and want to pass a variable from a parent block to a tool, you need to ensure that the variable is being correctly referenced and that the syntax for variable interpolation is correct. Here's a general approach to ensure that the variable is passed correctly: 1. Define the variable in the parent block. 2. Reference the variable in the tool call using the correct syntax for interpolation. For example, if you have a variable called
mc_number
that you want to pass to an external endpoint, you should reference it in your tool call like this:
Copy code
json
{
  "body": {
    "message": {
      "toolCalls": [
        {
          "function": {
            "name": "send_to_endpoint",
            "arguments": {
              "mc_number": "{{mc_verification.output.mc_number}}"
            }
          }
        }
      ]
    }
  }
}
Make sure that
mc_verification.output.mc_number
is the correct path to the variable you want to pass. The double curly braces
{{ }}
are typically used for variable interpolation in many templating languages, but the exact syntax can vary depending on the system you're using. If you've tried this and it's still not working, there might be a specific issue with the Blocks feature or the tool you're using. In that case, please provide the exact block configuration or the code snippet you're using, so I can assist you further. If you're still having trouble, please let me know, and I can help guide you through the process or provide further assistance.
v
@vaniacrunch It seems there might be a misunderstanding or a technical issue preventing your messages from coming through. If you're still experiencing difficulties with passing the variable from the parent block to the tool call, please ensure that you're using the correct syntax for variable interpolation within VAPI. If you're confident that the syntax is correct and the issue persists, it might be a good idea to reach out to the support team for more detailed assistance. They can provide you with specific guidance tailored to the VAPI environment and its features. Remember to check the following: - The variable name is spelled correctly and matches the one provided in the parent block. - The syntax for referencing the variable is correct for VAPI. - There are no additional syntax errors in your JSON or code that could be causing the issue. If you need further assistance or have additional details to share, please feel free to provide them, and I'll do my best to help you resolve the issue. If you're unable to provide more details or if the issue is complex, reaching out to support might be the best course of action.
v
@Vapi I see that variable passed successfully after I repeat it once again
v
@vaniacrunch That's great to hear! I'm glad the variable is now being passed successfully. It sounds like you were able to resolve the issue with the variable interpolation in your VAPI Blocks configuration. If you have any more questions or need further assistance as you continue to work with VAPI, feel free to reach out. I'm here to help you make the most of your voice development projects. Is there anything else you would like to know or any other support I can provide at this time?
v
Issue is that I need it to passed right after I pass it
@Vapi
v
@vaniacrunch I understand that you need the variable to be passed immediately after it's set. If you're experiencing a delay or the variable isn't being passed as expected on the first attempt, it could be due to a timing issue or the way the Blocks are executed. To ensure that the variable is passed immediately, you might want to check the following: 1. **Execution Order**: Make sure that the block which sets the variable is executed before the block that needs to use the variable. 2. **Variable Scope**: Confirm that the variable is in the correct scope and is accessible to the block that's trying to use it. 3. **Synchronous Execution**: Ensure that the blocks are executed synchronously if the order of operations is important. Asynchronous execution could cause timing issues. 4. **Debugging**: Use debugging tools or logs to trace the variable's value throughout the execution flow to identify where the issue might be occurring. If you've checked these aspects and the problem persists, it might be a more complex issue that requires a deeper look into your specific setup. Since you've mentioned that repeating the process seems to resolve the issue, it's possible that there's a need for a confirmation step or an additional trigger to ensure the variable is passed correctly on the first attempt. If you're still facing difficulties, please provide more details about the block configuration or the steps you're taking, and I'll do my best to assist you further. If the issue is too complex to resolve here, it may be necessary to reach out to VAPI support for more in-depth troubleshooting.
v
@User can you please help me with this topic ?
@User can someone help me with this ?
@User sorry for being annoying but its kinda urgent, can you at least tell me if I should wait for this ?
s
@vaniacrunch cn you hep me with call id?
v
sure bee76011-f321-4614-951e-f1028c9e6f33
s
Do let me know once your done with changes.
v
redefined, and call made once again
this is my app logs
816fa36e-1fdf-4cf8-828f-aa0e4bf33658 call id
@Shubham Bajaj
@Shubham Bajaj any updates here ?
@Shubham Bajaj already tried create completely new block, new assistand and even completely new account, every time same result, please help me with this
s
@vaniacrunch I checked with team our plan is to completely change blocks (rewrite) and because of this blocks are not ready for development and production usage as of now!!
2 Views