Unable to assign value from Datatable

1 Like

If you have a different question, make a new post.

Anyway…

CDec(in_transactionItem.SpecificContent(“Cashin”).ToString)

For Queue Items (transactions) the data is in SpecificContent (which is a dictionary of string, object). And you have to output it as a string to pass it to CDec.

image

1 Like

I assume you still don’t have the .ToString on them

CDec(in_transactionItem.SpecificContent(“Cashin”).ToString)

in_transactionItem.SpecificContent(“Cashin”) is an OBJECT. You can’t assign an Object to a decimal/double variable. You have to convert the Object with .ToString inside the CDec (or CDbl) conversion.

Mouse over the (!) and show us what the error is.

hey did u get this answer ? if yes please let me know i have got the same problem…!!

1 Like

Hi @Neha_Singh1

If you are using in_Transactionitem as Datarow use index instead of column name and try once

Regards
Sudharsan

Did you ever find a solution for this issue? I’m having the exact same problem and have tried the potential solution below, but simply adding the .ToString does not make a difference.

1 Like

@postwick I’ve tried your solution. Nothing. The error I keep getting is:
Can not assign 'CDec(in_TransactionItem(“CashIn”)) to ‘CashIn’

Studio keeps telling me I do not need Specific Content, and when I simply add .ToString to the CDec method I get the same error message. My project looks exactly like the example.

1 Like

@Emilie_Tole1 @uzair_khan @Neha_Singh1

What’s the type of the variable CDec, guys?

CDec isn’t a variable. It’s a function that converts into decimal. It’s C(onvert)Dec(imal)

1 Like

Again, please copy the entire error message and post it here.

You do need SpecificContent. Write the following with Log Message and tell us what you get:

“[” + in_TransactionItem.SpecificContent(“CashIn”).ToString + “]”

(don’t copy paste, the double quotes won’t be correct because of the font used on this web page)

Hi @Neha_Singh1,

I was looking the first screenshot you shared and I noticed that your in_TransactionItem is null. That was the reason you got that exception (Multiple Assign: Can not assign ‘CDec(in_TransactionItem(“CashIn”))’ to ‘CashIn’)

So, the problem is one step before (GetTransactionData). It must look something like this:

If you want, share your project. Then, I can take a look and identify what is causing the error.

Note: I understood that you are doing the course Build a ReFramework Project with Tabular Data, so you will not use .SpecificContent as you are not dealing with Orchestrator queues.

image

Thanks!

Hi @uzair_khan and @Emilie_Tole1,

Please check my post above if you are doing the course Build a ReFramework Project with Tabular Data (here you should not use .SpecificContent).

If you are doing the course Build a ReFramework Project with Orchestrator Queues, do not consider my post above and let me know (for this one you should use .SpecificContent).

Feel free to share your project. Then, I can take a look and identify what is causing the error.

Thanks!

Hello Mr Gustavo, i still have the same problem as this post and still cant find the way to get rid of it. Can i send you my project? thank u so much.

1 Like

Hi @Abram_Yct,

Sure!

Could you create a new topic and tag me?

Thanks!

1 Like