To obtain a random variable value from a list, first declare as User variables the list or available values, with a prefix and a incremental index:
country_1 Spain
country_2 France
country_3 Portugal
country_4 Italy
country_5 England
Then you can obtain a random value from the list concatenating the prefix with a random index in the interval:
${__V(country_${__Random(1,6,)})} --> "Spain", "France", "Portugal", etc...
Explanation
The __Random function will give you an index for your interval. To obtain values from 1 to 5, you have to call __Random(1,6,)
, as it will never reach the MAX value.
The __V function, will obtain the value of the variable with the given name.
${__Random(1,6,)} --> 1, 2, 3, 4, 5
country_${__Random(1,6,)} --> "country_1", "country_2", etc...
${__V(country_${__Random(1,6,)})} --> "Spain", "France", "Portugal", etc...
As example, to use the random variable as JSON body for a request, in Body Data:
}
"country":"${__V(country_${__Random(1,6,)})}"
}