22 Aug 2025
06:23 PM
- last edited on
25 Aug 2025
07:46 AM
by
MaciejNeumann
Is there a way to define a json data as variable, so that I can use in all the tiles as configuration data? It looks like code block as variable can only return a list.
DavisAI suggested this code, but that throws an error
export default async function () {
return [
{ "key1": "value1", "key2": "value2" },
{ "key1": "value3", "key2": "value4" }
];
}
The result of your code doesn't match the expected format. Please refine your code so that it returns a string or a list of strings like: ["green", "yellow", "blue", "purple"]
Even when I make the variable code to rerun an array like below, I am not able to access the values in the Tile code.
export default async function () {
return ["data1", "data2"];
}
Below code returns 'val1'. If I access 1st item it gives the value 'v'
export default async function () {
return $Variable4 ;
}