Translating collection uuid reference to collection label in JS editor

You’d think after using WeWeb for over a year, I’d already have this figured out, so feel embarrassed to ask… but is there an easier way to translate the collection uuid to the label of the collection as they are referenced in the JS editor?

eg. my collection named ‘Checkup_detail’ gets converted to collections[‘5427a68e-23f5-4cb1-84d1-3e3672b2d112’] when I use it inside the JS editor. That’s fine when I’m initially writing the code, but when I go back to look at something months later it’s a pain trying to figure out which collection that actually references.

in the js editor you can always edit the code to make it easy to mantain.

you can use comments:

// this is the posts collection
collections[‘5427a68e-23f5-4cb1-84d1-3e3672b2d112’]

or you can assign the value to a variable with expressive name:

const myPostCollection = collections[‘5427a68e-23f5-4cb1-84d1-3e3672b2d112’]
1 Like

oh ya… comments, figures that I would overlook a simple best practice.

I’ll have to see if I can instruct co-pilot to do it when adding new code. It does add comments about intent of certain sections.

1 Like