Parsing responseBody string dictionaries?

Hello, I have been looking for an answer few hours now :frowning: so I will ask it here. My goal is to set environment variable from responseBody so I could reuse it later on in other requests. Before I do that I want to first fetch that variable, however I encounter issues.

"tokens":"{'refresh': 'sample_refresh', 'access': 'sample access'}"

Please note that tokens is another dict, but passed as string
I want to get the value for access.
and here are what I have tried doing:

response = JSON.parse(responseBody);
tokens = response.tokens
accesstry1 = tokens["access"]
accesstry2 = tokens[1]

Result: "{'refresh': 'sample_refresh', 'access': 'sample access'}"
Result: undefined
Result: "'"

I also tried to re-parse tokens like this:

tokens = response.tokens 
tokens_parsed = JSON.parse(tokens)
Result JSONError: Unexpected token '\'' at 1:2 {'refresh': 

Please help :slight_smile: