0

I have an api Request such as this

    "partnerServiceId":"${partnerServiceId}",
    "customerNo":"${customerNo}",
    "virtualAccountNo":"${virtualAccountNo}",
    "virtualAccountName":"${virtualAccountName}",
    "sourceAccountNo":"${sourceAccountNo}",
    "partnerReferenceNumber":"${partnerReferenceNumber}",
    "paidAmount":"${paidAmount}",
    "trxDateTime":"${trxDateTime}"

The First column partnerServiceId is not needed for this case. So here is the sample csv I made, for one row. I used ",,".

application/json,16786 f65a899b974397a0b7692cfde37ee0f953eb972b,,1282513558,112081000000000,Latifah Hanum,1901000000000,20211105018,10002.00,05/11/2021 08:44

Here is the variable setting I'm using in CSV Data Config

Content-Type,Authorization,partnerServiceId,customerNo,virtualAccountNo,virtualAccountName,sourceAccountNo,sourceAccountNo,partnerReferenceNumber,paidAmount,trxDateTime

CSV data config

The Result came out like

Content-Type: application/json

Authorization: 16786 f65a899b974397a0b7692cfde37ee0f953eb972b

and for the request body

POST data: --RY0QSC1feIvTe02NIdE1n4T8bJi3bK3yiR---

Seems like only the headers came out right, what am I missing ?

BillyBudiharto
  • 17
  • 1
  • 2
  • 7
  • Tried to reproduce the issue with given data and request. Headers worked without any issue. Variables in the request body were not replaces are one field was missing in the data (blank value `partnerServiceId ` was counted). – Janesh Kodikara Nov 20 '21 at 16:32
  • @JaneshKodikara So solution is to remove 'partnerServiceId' , from my api request ? – BillyBudiharto Nov 21 '21 at 01:21
  • No. partnerServiceId value is retrieved correctly (i.e. blank) as expected. Apparently value for the partnerReferenceNumber not set. Hence the value of paidAmount set by CSV Data Set Config element. Also the value of ` trxDateTime` is null. Please check the column name counts and the value count. – Janesh Kodikara Nov 21 '21 at 12:36

1 Answers1

0

By default (with "Sharing mode" = All Threads) CSV Data Set Config reads next line from the .CSV file on each iteration by each thread (virtual user)

So if your CSV file really looks like:

application/json,16786 
f65a899b974397a0b7692cfde37ee0f953eb972b,,1282513558,112081000000000,Latifah 
Hanum,1901000000000,20211105018,10002.00,05/11/2021 08:44

you won't be able to use all the data in one iteration, either move everything into one like like:

application/json,16786,f65a899b974397a0b7692cfde37ee0f953eb972b,,1282513558,112081000000000,Latifah Hanum,1901000000000,20211105018,10002.00,05/11/2021 08:44

or consider switching to __CSVRead() function where you have more or less full freedom regarding which column to read and when to proceed to the next line

Dmitri T
  • 159,985
  • 5
  • 83
  • 133