I tried to convert from json to markdown (see post below)
I use the below code - but it seems as it wont run due to unknown forEach. When I have tried to use javascript in glide earlier on then I often cannot get the javascript to run.
Anyway to fix this?
let markdownTable = “| Store | Title | Period |\n|-------|-------|--------|\n”;
p1.forEach(item => {
let period = item.dateRange.replace("Present", "Now");
markdownTable += `| ${item.storeName} | ${item.jobShort} | ${period} |\n`;
});
return markdownTable;
As side node.
I used a “Query Json” as input to the javascript column - and even if looks as a valid JSON it is not.
I therefore used the “Query Json” column output as input in a template column - doing no manipulation with the input. The result was then valid JSON which the javascript accepted.
Check for any “keys” that might contain double quotes, the column will render your JSON but it doesn’t handle this error. You can run it through something like https://jsonlint.com/.
Always make sure you parse the JSON because it’s seen as text in the input phase like Darren wrote out.