Hi all
Wondering if there is a repository or similar of javascript code that works in Glide? For example, I just found the below script written by @Darren_Murphy in an old post that works great to list only unique values from a joined list… I thought one place to rule them all would be great!
const array = p1.split(', ');
const unique = [...new Set(array)];
return unique.join(', ');
2 Likes
No, not really.
JavaScript is often used as a bit of a last resort, when the job can’t be done with regular computed columns, or would be overly complicated to do so. So I’m not sure that it would make sense to have a repository of “common” use cases, because if it’s a common use case, then it can probably be done without JavaScript.
In the example you gave, the same result could be gotten with a combination of Split Text → Unique Elements → Joined List columns. I’m guessing the post you found was quite old - before some of those columns were available. I wouldn’t use JavaScript for that now 
2 Likes
Ahhh… True. I did search unique values for Glide and only found about using RowID which wasn’t applicable to my use and then found your javascript post. I will look at this new updated way 
1 Like
This is an important point, and maybe why we never have a big library of JavaScript use cases (unlike CSS).
I also have to stress that I have been bitten twice using JavaScript for corporation users. They blanket block JavaScript on their employees’ laptops.
1 Like
Good to know. So is there a repository for CSS? I haven’t used it within Glide (that I’m aware of) but interested to see how it would work within the app.
You can check it out here.
1 Like