How do I get return values from an Invoke activity?

Greetings!

After searching around here, I didn’t find anything that helped and thought I would try it this way.

I’m working on the Create Client Hash problem in Level 3.

I have created an Invoke GetClientInformation Workflow:

It passes the clientInfo value just fine but I do not get any of the output values.

What am I missing or what else can I share to help answer this?

Thanks!

Jon

we would have to see the code inside GetClientInformation.xaml to see why it is not assigning the values for the Out arguments…

Thanks for the response!

Here is both GetClientInformation, and Process. Process is where I call GetClientInformation.

Thanks!

GetClientInformation.xaml (11.0 KB) Process.xaml (9.4 KB)

Let me know if you need anything else!

Your selector for getting getTextAttempt seems not very good as
"<webctrl idx='1' tag='P' />"
You should avoid using the idx attribute because it is not reliable, maybe it is getting empty string?

I can’t argue with the bad selector! I assume the acme page was done that way on purpose, to force the dev to use something to get the data. (https://acme-test.uipath.com/)

It does work. I pass data into it because my GetClientInformation does get the ID (which I pass into clientInfo) and it goes to the correct detail page. When GetClientInformation returns, though, I don’t see any of the returned data, e.g. ClientID, ClientName, ClientCountry.

I have verified that the inputs have to be clientID, clientName, and clientCountry or it fails to compile. I used newly created variables ClientName, ClientCountry and then tried ClientID and res_ClientID but none of those variables end up with the results from GetClientInformation.

I step into GetClientInformation and see that the variables are set. It just doesn’t come back. Not sure what I have missed or what I’m doing wrong that I can’t pass the values out of GetClientInformation.

Thanks for the replies!

oh i think i see your problem, you have created variables when what you want in your Assign is to use the ARGUMENTS instead :wink:

Can you give me an example of what you mean?

As my first picture shows, I named the output variable and gave it a local variable. Does that not assign it? If that doesn’t, how do I assign it?

Thanks!

You need to make sure you are populating the Out Arguments and not internal variables or the values will not return to main workflow:

And i see you have variables with same name there

2 Likes

Okay, I’m renaming my variables in Process to res to differentiate them and will try that. I only had arguments in the GetClientInformation, no local variables, so that should be good.

I will try that and see how it works.

Thanks!

It doesn’t seem to work. When GetClientInformation finishes, none of the res variables are set.

What am I doing wrong?

Thanks!

So, where do I want to set it?

sorry that was wrong answer, if the resXXX are variables you have in your main workflow to get populated FROM the out arguments, then you are ok, something must be wrong inside the GetClient… flow still

Okay. I have no local variables in GetClientInformation. I only assign the arguments but nothing comes out from the results, even though I can step into it and see them set.

Can i have your current GetClientInformation file?

Sure!

GetClientInformation.xaml (11.0 KB)

Thanks!

You still have clientID, name and country as variables, you need to remove them like this:

1 Like

Gak! Okay, ugh on the UI. I did create local variables.

Yep, just saw that. Thanks! :relaxed::crazy_face:

1 Like

Okay, to be clear for anyone following me.

My mistake. When I switched to GetClientInformation, Arguments show at all times, but Variables only show when you have an item selected. This is due to how UIPath scopes the variables. So, I kept thinking I didn’t have local variables when I did. I had to pick an item in GetClientInformation before I saw them. I had to remove the local variables, so that the arguments were set. Once I did that, it worked fine.

Thanks bcorrea! You rock!! And thanks for your patience!

1 Like

for this assignment idx is stable