[postman-to-k6] Dynamically change variables

Hi all,

I’m starting to use k6, so probably my question is a very easy one, but i’m not figuring out if it’s suppose to work or what i’m doing wrong.

So my question is, the following action:

pm.iterationData.set("addedItemSimple", item.id);

is supposed to work in k6 script? You should be able to change variables dynamically? Because for me this is not working at the moment or i’m doing anything wrong. It gives the following error:

ERRO[0023] TypeError: Object has no member ‘set’

If you need more details please let me know.

Thanks in advance :slight_smile:

Meanwhile i figured out that you can only set variables dynamically using global variables. Using global variables i was able to use the method set. For example:
pm.globals.set("addedItemSimple", item.id);
This works as charm.

Thanks anyway :slight_smile: