I want to use moment lib in the global script for create a function

I created this global function but using moment like this is not working and its showing error.
What is the way to use moment or any other external library here
image

Hi, welcome to the community!

You shouldn't need the {{ }} brackets to call moment. It should simply be available within the function.

1 Like

Ok yeah! it worked. Every time i typed moment it auto suggested adding "{{ }}" so i did.
Thank you so much @brettski

You're welcome. Use the {{}} in places within ReTool where you not writing JavaScript already, like resource fields, component names, etc.

It's explained here: https://docs.retool.com/docs/javascript-overview

1 Like