Collection Variable not updated from Post Request Script

Collection variable is not updating from my post request script:

script:

let decryptVerifier = eval(pm.globals.get("decryptVerifier"));let decryptedPayload = JSON.parse(decryptVerifier(JSON.stringify(pm.response.json())));console.log('decryptedPayload,decryptedPayload')console.log("decryptedPayload.loanDetails =>> ",decryptedPayload.thirdPartyLoanDetails.eligibilityRequestId)const eligibilityRequestId = decryptedPayload.thirdPartyLoanDetails.eligibilityRequestId;console.log("eligibilityRequestId==>> " , eligibilityRequestId)

decrypted payload:

note:
script work when valu is set as global variable

I can’t see anywhere in that script where you set or use a collection variable.

let decryptVerifier = eval(pm.globals.get("decryptVerifier"));

let decryptedPayload = JSON.parse(decryptVerifier(JSON.stringify(pm.response.json())));

console.log('decryptedPayload,decryptedPayload')
console.log("decryptedPayload.loanDetails =>> ", decryptedPayload.thirdPartyLoanDetails.eligibilityRequestId)

const eligibilityRequestId = decryptedPayload.thirdPartyLoanDetails.eligibilityRequestId;
console.log("eligibilityRequestId==>> ", eligibilityRequestId)

Sorry, it was a mistake.
here is the actual post script used.

1 Like

same issue as this topic:

seems like more and more people have this issues. unfortunately there is no fix yet

1 Like

Hey folks, sorry you had to face this issue.
Can you please try logging out and logging back in the app once and run the scripts again?
This will clear your local current values of variables, but the scripts should set the correct values of variables from there on.

Well.

Logging out and back in, meant I lost ALL my environment variables!

Still not used to this new method of working.

There’s no longer a save button in the environment, so how am I supposed to ensure all my environment variables are actually saved and can survive logging out. Do I have to share them?

I’ve tried sharing a couple of the variables, but the script is still not updating them, yet, as per my post in the thread linked earlier, during post-response script execution i run a test which checks the environment variable matches the value in the response. How is it doing this test and showing success, then not actually saving it?

Any guidance appreciated.