PHPScript

PHPScript is the scripting language that powers InfoLobby automations. Every visual flow you build compiles down to PHPScript, and you can also write it directly in code mode when you need logic the visual builder doesn't cover.

If you've used PHP, it will feel familiar — same variables, arrays, control flow, and many of the same built-in functions — plus a set of InfoLobby functions for working with your records, comments, files, email, and integrations.

Visual builder vs. code mode

Most automations are easiest to build with the visual flow builder. Drop to code mode when you need to:

  • Loop over query results and branch on each row
  • Build a value from several fields with string or math operations
  • Call an external API and parse the JSON response
  • Do anything with conditionals/loops that's awkward as bricks

You can switch a flow to code mode from the automation editor. Visual bricks and code are two views of the same thing — both run the same functions documented here.

How PHPScript runs

  • Inside a flow. Your script runs when its flow triggers (record created/updated/deleted, on a schedule, manually, or via webhook). The trigger record is available as $record.
  • As the acting user. Functions that create tasks or own actions run as the user who triggered the flow. Automated triggers (cron, webhook) may have no acting user — some functions skip in that case (noted on their pages).
  • Workspace scope. A script can only reach tables in its own workspace plus any granted via Additional Workspace Access.
  • Logged. Every run is recorded in the flow's run log. Use sys_log() to add your own debug lines.
  • Record changes by flows are tracked in activity history but do not re-trigger other automations.

New to the language? Start with PHPScript basics.

Function reference

Records

Querying

HTTP & API

Email

AI

Dates & system

Flow & tasks

Text & arrays

Data generation

The old `sql_select()`, `sql_insert()`, `sql_update()`, and `sql_delete()` functions are **deprecated** and now throw an error. Use the record functions instead: [records_query()](/help/phpscript-records-query), [record_create()](/help/phpscript-record-create), [record_update()](/help/phpscript-record-update), and [record_delete()](/help/phpscript-record-delete).

Standard PHP functions for strings, math, arrays, dates, and JSON are also available — see PHPScript basics.