Substitute Variables in Files Javascript Array

Hi,

I have searched around the current support tickets and could not find one that related to my question.

I’m wanting to use the “Substitute Variables” in a JavaScript file, but i’m wanting the value to be an array
Is this possible?

Currently when I try to do this I just get "[{Key: "Test"}]" but what I actually need is [{Key: "Test"}]
This is because of the value data type which is set to string

Thanks, James

Hi James,

I’m not sure exactly which method you are using to substitute variables, but I have confirmed that if you use the “Substitute Variables in Files” feature, you should be able to achieve what you are looking for.

For example, in my package I have a file named test.js with the contents var test = #{SubstituteThis}. I enable the “Substitute Variables in Files” feature in my deploy step, and tell it to process the test.js file. The resulting contents of the deployed test.js are var test = [{Key: "Test"}]

Hopefully that answers your question. If I have misunderstood or you reach another hurdle, please let me know.

Regards,
Jayden

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.