Inserting Custom Variables into Code Execution

(ality) #1

I have a variable that will change (closest), ince this changes it will then call data relating to it from a json file.

how do i insert the variable ‘closest’ into other variables? It works for ‘location’, but ‘dist’ throws an error.

var closest = 1;

var location = {{check_against_locations.data__destination_addresses}}[closest];

var dist = {{check_against_locations.data__rows__0__elements__closest__distance}};

(Matt Durr) #2

Not clear on what you’re trying to do here. If you’re trying to manipulate variables, it’s probably best to do that in a Code block. You can input them, make any changes you need with Javascript, then export the updated variables for use in later Flows.