thunder-client-support
thunder-client-support copied to clipboard
Is there a way to get and set the data through script in collection run?
Question:
Is there an equivalent of postmanpm.iterationData.get or pm.iterationData.set in TC to set or get values from csv when running a collection?
Are you using the free version/paid version/trial: Free
No we don't have similar API in TC
Can you please share your use-case and examples, We will review and add to the roadmap.
My use case is,
- Create a csv file with user-friendly names.
- Fetch these user-friendly names during "collection run" and parse the API response to fetch the corresponding id (lengthy and not user-friendly) for the respective user-friendly name.
- Use the id fetched in step 2 in next API call which is part of the collection.
- Repeat this process for all rows in the csv.
Thanks for sharing the use cases, Will review it.
please try below methods
- pm.iterationData.get ----> tc.getVar
- pm.iterationData.set ----> tc.setVar