Whenever i'm trying to use my custom connector in uipath i'm facing error :-Unable to cast object of type "System.String to type 'System.Activities.InArgument'1 [System String]'

Hi All,

I have created a custom connector with no parameter and it is working fine when I’m running it in postman or in integration services but when I’m using it in my UiPath studio it is giving me continuous error of:
Unable to cast object of type "System.String to type ‘System.Activities.InArgument’1 [System String]’.

Please let me know how to resolve the issue.

Regards,
Maninder Singh

Hi @maninder_singh
Please try following the below steps. It might resolve your issue.

  1. Check the data type of the input parameter in your custom connector:
  • Ensure that the input parameter of your custom connector is defined with the correct data type. In this case, it should be System.String.
  1. Verify the argument type in your UiPath Studio workflow:
  • Open your workflow in UiPath Studio.
  • Locate the activity or expression where you are passing the argument to the custom connector.
  • Confirm that the data type of the argument being passed matches the expected data type of the custom connector’s input parameter (System.String).
  1. Validate the argument assignment:
  • If you’re assigning the argument dynamically within an expression or variable, double-check that the result is of type System.String.
  • Ensure that the argument is assigned correctly using the appropriate activity, such as the “Assign” activity.
  1. Check for any conflicting argument names:
  • Make sure that there are no conflicting variable or argument names within your workflow that may be causing a data type mismatch.
  1. Refresh the custom connector in UiPath Studio:
  • If you made any changes to the custom connector (such as modifying the input parameter data type), try refreshing or re-importing the custom connector in UiPath Studio to ensure that the latest changes are reflected.

Regards,

Hi @Parvathy,
Thank you for the response.
please find the attached issue I’m getting


and also there is not input parameter in my custom connector.

Any updated solution on this . I am facing same error. Please advice.

I encountered similar issue recently (not with connectors but while troubleshooting a project going through Legacy Migration to Windows). I resolved this issue by updating UIAutomation.Activities and System.Activities to correct version (in my case 22.10.5.)