Invoke code, error CS0029: Cannot implicitly convert type string to int At line 3

I believe I have met a strange issue.

image

I did not convert from string to int as in the images but the compiler complain that the code has.

Hi @NYK888

There’s little chance of this, but do you have an INT variable in your workflow called Mobile?
The invoke code argument and variable name may cause some confusion.

I don’t have variable called Mobile in the workflow.

If expert like you can’t see any error, is it that invoke code got issue? As I just updated a version last friday.

it could be the case that some bugs within the invoke code will occur
another issue in your code is:

*DictDT.Select(…) will return an array of DataRow

  • row[“Mobile”]… should fail as row is an array

rows.First()[… could help when the assumption there will be always returned only a single datarow

Howevever we would recommend:

  • avoid invoke code as we can do it with alternate statements also within assign activities

Have figured out that after using DataTable.Select to extract the data into array of datarow, the code to extract the individual items is not correct. Can anyone help?

The code is above. Thanks.

We can confirm that the select method is creating confusions within the combination UiPath / Invoke Code / C# …

We also told, that it can be achieved within an alternate way.

When you are interested on an alternate approach, then just share some sample data with us. Thanks

Hi all,

I have solved the problem by manipulating DataTable instead of array of dataRow in Invoke code.
Then the error above will not appear and the program is able to retrieve the field accordingly. Thanks.

Thanks all for your help.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.