Assign invoke code

Hi, I have this huge quantity of variables to assign values of a table row and I want to assign all the variables with an Invoke code to not make a huge sequence with a lot of assigns in it.

But i don’t know how to do a simple genericValue assign into the invoke code.

for in_Arguments i just put the ‘row’ variable type datarow, and out_arguments are the bunch of genericvalue variables.

Can you help me with this?

Can you please try using Parallel Activity.

Drag Assign Activity as many as you want in parallel activity, and assign your variables as per your requirement.

1 Like

Well,

I can give you a workaround which is a bit of a compromise but shorter nonetheless.

Have all your generic variables -collected from whichever source- in an array.

Store everything in a dictionary in a loop.

Basically TableRow or DataRow into array and store it in Dictionary in Key - value sequence.

I can think of this way, maybe there is a better or optimum way… :slight_smile:

Regards

PS If you are worried about he sequence being too long (a visual blocker) then you can collapse that sequence as and when required or use parallel activity (which @Purvi suggested - that can also be collapsed. )

Hi @Raghavendraprasad thank you for your answer. Now i´ve created an array with all headers that I’m iterating with a for each and I’m putting all the data in a same string without assign anything.

But I’ve really want to know how to make an assign of several variables just with one invoke code. I mean, I’ve already solved my problem into the .xaml but I want to know already if there is an answer to this question. Just for Knowledge.

Thank you :slight_smile:

Well,

As far as my extent of knowledge all I can say is -

For your objective to be feasible you need a ‘Collection’ and loops to assign. There should always be a reference - means, For you to assign input=output you should know both input and output.

In UiPath you can invoke code/Method all you want, but unless you have a collection of all that you want to access when looping through it I am not sure as to how we might go about it, because I can’t think of any (according to my knowledge)

But, when I had more than 2000 variables to be assigned repeatedly I have used looping through dictionary/collections in a foreach loop every-single-time. Using a code/building a custom activity for it just to replicate what Uipath does using the reusable activities is counter-intuitive is what I tend to believe.

Hope this answers your question, at-least to some extent :slight_smile:
Regards