Change a collection variable dynamically with Newman

I’m not sure what value you have set as testVariable on the command line and why that needs to be parse that way. :thinking:

Also, at that point it would just be the string {{testVariable}} because that’s what you have set as the variable. You’d need to use .replaceIn() to resolve that value.

Using my example:

let non_resolved_var = pm.collectionVariables.get("testing");
let resolved_var = pm.variables.replaceIn(pm.collectionVariables.get("testing"));

console.log(non_resolved_var)
console.log(resolved_var)

Would display this if logged out the console: