Input Variables Error

Hello, I have an error while passing input variables to the Agent.
If I hardcode the values of the variables at the userprompt, it works.
But, when I pass the variables value {{var}}, it doesn’t work. All the variables are added to Data Manager.

Hi @Brahimco,

You need to provide a clear description for the variable in the tool configuration that the Agent uses to find the stock. This helps the Agent understand what value should be passed to the tool parameter.

Also, try slightly modifying the user prompt to make the expected input more explicit. In many cases, the Agent is able to resolve hardcoded values but may need additional context to correctly interpret and pass variables from Data Manager.

Thanks

@Brahimco

Normally the variable names gets highlighted with green colour. In your case I don’t see it so I will suggest to take hello from autopilot to refine user prompt.

@Brahimco

  • Go to Data Manager section
  • There you can see whether the arguments/variables are created or not.
  • Once those are created then you can see those avaialable in green colour.
  • Check the spell mistakes and check the both are in same case(uppercase or lower case)

Let me know whether it works or not
Happy Automation

If hardcoded values work but {{variable}} does not, first verify that the variable names exactly match the Data Manager fields and that values are being populated at runtime.

Also, don’t worry if the variables are not highlighted in the prompt editor. In many cases, they still resolve correctly during execution. For example, instead of:

Order ID: {{OrderID}}

you can try using the same syntax as shown in the screenshot

After Execution

@Brahimco Please check the below points and let me know if it works

  1. In Data Manager, create these as Input arguments, not local variables:

orderId
productId
quantityOrdered

  1. Use the exact same names in the User Prompt:
    Order ID: {{orderId}}
    Product ID: {{productId}}
    Quantity Ordered: {{quantityOrdered}}

    Please check if we have enough stock for this order.

  2. Do not manually type the variable if possible. Type {{ and select the argument from the suggestion list. This avoids spelling/case mismatch.

  3. When calling the Agent from Maestro/Studio/Web, map the workflow variables to the Agent input arguments, for example
    orderId = orderIdVariable
    productId = productIdVariable
    quantityOrdered = quantityVariable

  4. If the value is a number, object, or JSON, try converting it to String first or define the argument type correctly.

Also, make sure each input argument has a proper description, because UiPath recommends descriptions for both input and output arguments so the agent can use them correctly.

So the main fix is: use Input Arguments and map them properly before starting the Agent. Normal variables in Data Manager will not be substituted automatically in the prompt.

Thank you guys ! Looks much better now.

@Brahimco

Same scenario i also faced, instead typing your variables in {{}} in these brackets, if you created variables in data manager section, go to the User prompt section,
There type @, after entering this in your userprompt you can see whatever created variables/arguments there you can select.

Find the below screenshot for refernce,

If you find this helpful, please mark it as solution.
Happy Automation

Hi @Brahimco,

If your issue has been resolved, please consider marking as the solution.

Thanks