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
- record_get() — fetch one record by id
- record_create() — create a record
- record_update() — update a record
- record_delete() — delete a record
- record_comment() — post a comment on a record
- record_email_send() — email logged on a record's thread
- pdf_generate() — render HTML to a PDF onto a file field
Querying
- records_query() — find records with filters
- records_query_one() — find a single record
- records_count() — count matching records
- records_query_from_view() — query using a saved view
- records_related() — records linked to a record
HTTP & API
- curl_request() — HTTP request, full control
- curl_get() — GET request
- curl_post_json() — POST JSON
- curl_post_form() — POST form data
- api_request() — authenticated request via an API integration
- url_get_contents() — fetch a URL's contents
- smtp_email_send() — send an email via an SMTP connection
AI
- openai_gpt() — call OpenAI GPT chat
- openai_assistant() — call an OpenAI Assistant
Dates & system
- sys_current_date() — today's date in the owner's timezone
- sys_current_datetime() — now, in the owner's timezone
- date_to_utc() — convert a local datetime to UTC
- date_from_utc() — convert a UTC datetime to local
- sys_log() — write a line to the run log
Flow & tasks
- flow_execute() — run another on-demand flow
- flow_url() — public URL of a webhook/web-page flow
- task_assign() — create and assign a task
- field_contains() — test membership in a multi-value field
- flow_text() — flatten a multi-value field to text
Text & arrays
- array_search_col() — find a row by column value
- array_sort_col() — sort rows by a column
- preg_match_gf() — regex match, return one group
- preg_match_all_gf() — regex match all, return one match
- strip_tags_gf() — HTML to readable plain text
- markdown_to_html() — render Markdown to HTML
- memory_used_pct() — remaining memory percentage
Data generation
- il_random_text(), il_random_title(), il_random_html(), il_random_number(), il_random_option(), il_random_date(), il_random_datetime() — generate sample data for testing
Standard PHP functions for strings, math, arrays, dates, and JSON are also available — see PHPScript basics.