Data Parametrization

i am new to K6 , In my script , i have a POST request where i need to parametrize certain values like phone number , account number …etc ,
the payload looks as below

“RequestType”: “Association”,
“Version”: “V1”,
“AssociateAccount”: [
“accId”: “12365498”,
“encryptedsecuritycode”: “MTIzZXJkdA==”,
“phonenum”: “6756453782”,
“originator”: “dummy”

My have created below script , however when i am running it the value is not getting passed in request rather the variable name is getting passed ,

import { sleep, check } from ‘k6’;
import http from ‘k6/http’;
import papaparse from ‘’;
import { SharedArray } from ‘k6/data’;

const data = new SharedArray(‘phonenumber’, function () {
return JSON.parse(open(’./CstData.json’)).phoneno;

export default function main() {

const randomPhNo = data[Math.floor(Math.random() * data.length)];

let response;

response =”,
‘{\r\n “RequestType”: “Association”,\r\n “Version”: “V1”,\r\n “AssociateAccount”: [\r\n {\r\n “accId”: “12365498”,\r\n “encryptedsecuritycode”: “MTIzZXJkdA==”,\r\n “phonenum”: “${randomPhNo}”,\r\n “originator”: “dummy”\r\n }\r\n ]\r\n}’,
headers: {
Accept: “application/json”,
“Content-Type”: “application/json”,
“X-Payment-experimentation”: “V1”,

Could you please help?
Thanks in advance!

I got it working by using a Javascript template string surrounding the body with backticks instead of single quotes, and embed the variable using ${} :

{\r\n “RequestType”: “Association”,\r\n “Version”: “V1”,\r\n “AssociateAccount”: [\r\n {\r\n “accId”: “12365498”,\r\n “encryptedsecuritycode”: “MTIzZXJkdA==”,\r\n “phonenum”: “${randomPhNo}”,\r\n “originator”: “dummy”\r\n }\r\n ]\r\n},