menu

LobbyScript PHP Examples

Automation calculations use a custom DSL similar to PHP with some JavaScript niceties.
We call it LobbyScript. Most PHP functions are supported.

Here are some of our most used examples:

Add days to a date

date('Y-m-d', strtotime( @{int:current-date} + ' + 30 days'))

The placeholder @{int:current-date} refers to the current date variable. You can replace it with any other date variable of your choice.

Difference between 2 date fields

intval(strtotime( @{var:current-start} ) - strtotime( @{var:before-start} ))

The placeholder @{int:current-start} refers to the date field for the Start date and @{var:before-start} refers to the value of this field BEFORE. You can replace these with any other date variable of your choice.

Create JSON array

tojson(["Name" => @{var:summary},"Date" => @{var:date-24},"Status" => @{current:status}])

The placeholder @{var:summary},@{var:date-24}, and @{current:status} refer to variables required from the record to create the array.


InfoLobby © 2024 Globi Web Solutions