I am working on a HTTP request, where I have to convert a piece of a Python code to UiPath.
More specifically, we are talking about this line of code listed below
I have succesfully assigned a variable named “headers” and given it a dictionary where the first key/value pair is {{“accept”, “application/json;charset=utf-8”}…} however, the second key/value pair I am a bit confused as to what to do since there is a variable inside the assignment. Doing simply {{“accept”, “application/json;charset=utf-8”}, {“authorization”, “Bearer {access_token}”}} obiviously gives an error. How do I correctly insert an variable into my other variable in the assignment activity?
PS. You may assume that access_token already exists and is correctly assigned.
PSS. I do not know the correct theoretical term for this, if you know, please let me know so I can become better at explaining my future errors and struggles
Thank you beforehand and have a wonderful day/ night forward!
If this is happening after replace activity then it Looks like your variable might be empty.
If it is happening before the relace only then access token is not being assigned only…please run in debug mode and check the locals pane after each step into and see whaere the data is getting empty
You are right. My variable was empty even though I initialized it. Doing a simple “Assign” activity before declaring the headers fixed this issue. I am now getting the correct output, thank you very much sir Anil!