0

Problem statement:- I am trying to use data variables in pre-request section and I am unable to retrieve values from CSV data variable. I tried using the below two options but still no data is seen when I try to log the value nothing is displayed; - Data.Variable - pm.iterationData.get("variable")

Please verify if the below is right?

Data File:

Account_Number,Account_Name,Customer_ID,Currency,Account_Type,Account_Sub, Category 100000002,SWEEPY GROUPS 001,1507400001508,THB,DA,SAV,I 10000019,SWEEPY GROUPS 019,1507400001508,USD,DA,SAV,E A9871100000020,SWEEPY GROUPS 020,1507400001508,USD,DA,DDA,E

PRE-REQ:
console.log("Customer ID"+JSON.stringify(data.Account_Name))

In Console: resultant

Customer ID     undfined

Please suggest an alternative how can I get it running.
JACOB SAMUEL
  • 3
  • 1
  • 4
  • Can you clarify the question please. Its difficult to know what you're doing. Are you just trying to log out the data in the file? Have you tried using `pm.iterationData.get(variableName:String)`? – Danny Dainton Jan 05 '19 at 09:32
  • When I changed the File format to JSON, it worked fine. Any reason why the code did not pick values when it was a a CSV file? – JACOB SAMUEL Jan 06 '19 at 11:01
  • No reason unless the format wasn't correct. How did the preview look? – Danny Dainton Jan 06 '19 at 12:09

0 Answers0