Reading variables in current working activity

Hi all,
While running code in debugging is there any possibility to read in locals values within the current activity?

I mean I would like to see for example stuff that is happening in the following activity:

I have activity get token
-In - endpoint Uri, username, password
-out - token, response code

What I would like to do is to see the value of a variable inside this activity so I can wait until the variable will change a value.

If you use API sometimes when you have a bad connection it might take up to 5 min or more to get a response value.
The purpose why I need it is fallowing:
I would like to create activity “as scope” and put into it this API request and it would not go to the next point until the value of out will change. Retry scope and While loops won’t apply here as:

While loop can be passed by timeout and then retry execution of send request so it won’t show the value of the previous request when it will execute another same request.
Retry would re-execute activity after the defined condition in try-catch in it.

Does anyone have any idea how to get values in the activity block code?

Also for Admins @loginerror for 03. Official Activity packages would it be possible to add an API tag?

you can check the current value of a variable using immediate panel
or else if you want to change the value of variable during debugging thats also possible using watch panel

hey, thanks this I know :slight_smile: it’s about checking the value of the vars in activity when it’s executing - stuff in it.

The various panels show you everything. What do you mean “stuff in it?” It shows you the value of variables and if they’re complex like dictionaries you can expand and get to the keys and values, etc.

Yeah you can check values of all the variable while executing using immediate panel
or else if you want to print the values of variable you have to use message box |log message | Write line

A single activity is a black box. You cannot see/read/debug the information inside an activity. Only the data that goes in before it starts, and the output when completed.

Physics joke: there might even be a dead or alive cat in it… you’ll never know.

1 Like

Wouldn’t this be solved by increasing the Timeout property of the HTTP Request activity?

Is the problem here that the HTTP Request “finishes” to quickly, thus never receiving a response, thus messing up the sequence?

Typically, when I handle HTTP Requests I put them in a Do While loop with a condition based on the statusCode, while simultaneously having a Switch activity inside of this loop that handles different status codes (i.e. for 429, it will read the header retry-after if it exists and delay the next loop repeat to slow down a bit).

Wouldn’t it be possible to have both:

  • high timeout set for your HTTP Request activity so that it “waits” until the response is received
  • custom handling of each important status code so that you can retry things if they fail.

Or maybe I got it all wrong, and this is a new feature suggestion for a sort of HTTP Request scope that would automatically keep the connection alive based on the specific API call that needs to happen first to authenticate?

The HTTP Request activity is part of the Web activity package, which is already on the list :sweat_smile:

1 Like

Thx, I wasn’t sure :slight_smile:

The problem with your approach is very simple, due to our infra problems which external providers don’t know how to fix(feel my pain…) API Call can take from 1s up to N hours… so even timeout may not help. Until we move into the cloud I cannot use the interaction module which you have, and I have to use the UiPathTeam activity for SNow.

Regarding Do While loop, I was considering this option but tell me how does it work:

API HTTP request is sent and now I’m waiting for code/ response, we have a timeout set into 10s,
when I breach timeout program will send another request until the response code will have value int 200. When the timeout response from 2 loops before will be back then the activity will ignore it or will get that response and present it as an output of 3rd loop?

I’m wondering if the answer is somehow tokenized and will not be recognized as a response from the server.

Another thing is my question about the values of vars in the activity in the studio when we are using some of them we see them as a single brick in graphic representation. But if we have a source of it we and open it we see whole code behind that brick.
My question is can I without a source of the library (only this brick in sequence) get values or see these variables which are in the brick?