Commands for your own handler
Connect existing Google Apps Script logic to your app buttons.

Where: More → App settings → App handler. For a button: Logic → Call the app handler.
Use this connection when your Apps Script already owns bookings, capacity checks, prices and notifications. It requires a compatible Build Mini adapter that checks Telegram signatures, client permissions and repeated requests. Connect the same Telegram bot to the app in the builder. Your handler developer prepares the adapter.
- Enter the deployed web app URL, https://script.google.com/macros/s/…/exec. Keep keys and tokens out of the URL.
- List the adapter’s confirmed method names in Allowed commands, one per line. Example name: apiLoadProfile. Entering a name does not create that method in the script.
- Add Call the app handler to a button, choose the command and enter a JSON array of arguments. Pass only action arguments. The signed launch identifies the client.
- Optionally save the response in a variable and use it in later actions. Show success after the handler confirms the result. A rejection stops the action chain.
- Publish the project and open it from the connected Telegram bot. Check two different clients, access to private records and repeated taps.
If the handler needs more than 30 seconds, the app continues waiting within the request’s overall time limit. Wait for loading to finish. If an error appears, use Retry.
The Call app handler action includes Data after completion. Refresh and wait preserves the usual order: command, data reload, following actions. Refresh in background starts following actions after the command is confirmed and reloads the list separately. Use background mode when the continuation does not need fresh table rows. Do not refresh suits commands that need no reload. Booking or payment confirmation always waits for the handler response.

Background refresh preserves the list’s last state. An error stays visible until a successful load or Retry. Configure screen-specific loads for separate handler sections. If loads share reference catalogues, mergeKeys combines their rows by id within one refresh. Replace private record lists entirely so deleted records cannot return from an earlier response. For relations, return row IDs from configured tables. Links resolve to two levels, such as class → room → branch, and update with their reference catalogues.
Repeated background refresh joins the current screen’s pending load. After a confirmed command, the app requests fresh data. If the handler returns explicit booked and free values, the app preserves that overall occupancy: one visitor’s private bookings cannot determine it.
If the handler connection briefly fails, the server retries the configured data load once within the original time limit. Use read commands for data loads. Booking and payment commands only retry manually with the same request ID.
Handler arrays can be mapped to JSON variables and displayed as lists. Map the variable name to an array in the response. The list shows loading until the response, an error with Retry on failure, and an empty state only after a successful empty response. Ordinary local lists remain immediate.
Notification templates and booking rules stay in your handler. Writing a table row directly does not run those checks. During maintenance, owners can open the app and run commands from their linked Telegram account, even without table-editing permissions. Other visitors remain blocked. Launch signatures, the allowed command list and handler checks still apply. After an update, close the app and reopen it from the bot.
For a compatible handler, a developer can enable direct checkout and automatic result checks. Secure checkout opens during the tap. When you return, the app checks that same payment while the app remains open. Confirmation appears only after the server verifies payment and applies the purchase. If payment is still pending, you can continue it or check manually. Closing the app stops automatic checks. The handler sends notifications. Bank verification and instant-payment apps may open separately.
If the handler rejects the payment request, the checkout page stops waiting and directs you back to the app, where you can see the reason.