Hi!
We have multiple URL’s stored in a Text column which is essentially JSON.
I wanna utilize the URL/link component in the glide app, but can’t figure out a way to show all the URL’s, I could use the Query JSON to break up the JSON into multiple columns, but it’s messy and it’s difficult to tell how many URL’s could be included for a given record.
Okay, that’s fairly straightforward. You can use a variation of the Miracle Method.
You just need a helper table with enough rows to cover the maximum number of expected URLs.
Then add a row index column, apply your JSON to every row, then extract a separate URL on each row. You could use a Query JSON column, but that would require an extra template column, so I’d probably use JavaScript.
Aha, and which collection type would be the prettiest to present? I really like the link component, but that’s obviously on a column basis, not a collection
Another alternative might be to use a HTML template in a Rich Text component. With a bit of inline styling you could probably make them look like Link Components.
The link component works with arrays. You shouldn’t need a helper table or multiple rows to accomplish this. At most, you would only need 1 or 2 columns to convert the text to an array, and then make that array the source of a Link component.
One thing I should mention is that because in this case you’re returning everything on a single line, you could drop the JavaScript in favour of a Query JSON column:
ok so update, apparently it comes into glide as comma separated, not as an array… (even tho in PostgreSQL is a JSON column)
so in theory it should be simpler, i’m using the split column to create an array, but when I’m trying to set the split column, it does not give me the option to reference it.
I don’t know if it’s a limitation with SQL as a source or something else…