Skip to content

Built-in methods

The documentation applies to:✅ v0.8.0

What is built-in method?

Sometimes you see an interpolation {{ }} isn't enough function to help you manipulate a data before they translate into real value. For example: you want to insert a current date into database. So that LET Portal is building a lot of built-in methods to help you fill this.

Built-in methods Cheatsheet

Method Description Params Translated value Usage
currentDate() Get a current local date as UTC string None "Wed, 04 Mar 2020 16:54:17 GMT" Very useful on SQL, ex: modifiedDate={{currentDate()|date}}
currentISODate() Get a current local date as ISODate string None "2020-03-04T16:56:28.308Z" Very useful on MongoDB, ex: modifiedDate: ISODate('{{currentISODate()}}')
currentTick() Get a current local date as long tick None 621355967995800000 Very useful on Timestamp field, ex: timestamp={{currentTick()|long}}
guid() Generate GUID string None "930ac896-d2e9-4786-ae75-00c9452b8707" Very useful on some unique field
toJsonString(param1) Serialize one object to string Param1: object|any "{'data':'abc'}" Very useful on some json string fields