Put out argument into a DataTable

Here’s an odd one.
I have a workflow. The workflow takes a number formated as a string, and converts it into currency format. The output is also a string.
I want to loop through a datatable and format all the number strings to currency.

So I have a For Each Row set up.
Inside the loop I invoke the workflow.
Arguments are as follows:

I’m getting an error on the output saying "Option Strict On disallows implicit conversions from ‘Object’ to ‘String’.

Any idea why this would be the case?
I can work around it by adding an additional step - popping the output variable into a new string variable and then using an Assign to put the string back into CurrentRow, but it feels rather inelegant.
image

Hi @JohnMac

Please create variable of Type string (Ex:FormattedCurrency) and use it in the second argument values instead of CurrentRow(colNumber).

Please let me know your comments. Thank you.

Thanks @Jobin_Joy - that is the workaround I am currently using (see the additional step I describe in the original post. But I don’t understand why that error message is occuring - I am not converting an object to a string. #bug ?

@JohnMac

In the For Each loop if you check the Type Arguments it’s a Object, so you need to make it as CurrentRow(colNumeber).Tostring

Hope this may help you

Thanks

@JohnMac

Check below for your reference

image

So you require a variable to store the output

Hope this may help you

Thanks

1 Like

In the For Each loop if you check the Type Arguments it’s a Object, so you need to make it as CurrentRow(colNumeber).Tostring

Unfortunately not, because this is an output - I am writing to the currentRow, not the other way around.

for out direction , always you should have a variable to store the value , please use the string variable

It’s not a bug. Based on the TypeArgument we have to convert it to respective type.

Thank you.

Hi @JohnMac ,

Just now tested at my end if we change the type to object in the invoke work flow. it was no throwing error and working as expected like storing the new values into the column. please try and let us know. if we change the type to object also we can assign string values into it.

image

OutArgumentDemo.zip (11.5 KB)

2 Likes

Ah - well done. Thank you!

1 Like

Thank you. Your most welcome @JohnMac .

1 Like

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