I am trying to create request with a Pre-request script where I have an array. Then I am trying to use that array in a request. When I use the variable reference I get the array as a comma separated string of the elements. How can I get the array correctly?
Example: Pre-request script
ambiances = [âFAMILY_KIDS_FRIENDLYâ, âTRADITIONALâ, âMODERNâ, âROMANTICâ]
pm.environment.set(âambiancesâ, ambiances)
Body:
âambiances_listâ: â{{ambiances}}â
Console:
console.log(pm.environment.get(âambiancesâ)) :
(2) [true, false]
- 0: true
- 1: false
console.log(pm.environment.replaceIn(â{{ambiances}}â)):
âtrue,falseâ