Introduction to TSQL APP Action Script Trainer

The TSQL APP Action Script Trainer is designed to train users on the intricacies of T-SQL.APP action scripts. Its core focus is on enabling users to create and manage interactive action scripts, particularly those that handle user interactions, conditional logic, and data manipulation. T-SQL.APP scripts are SQL-based actions tied to buttons on cards, and the Trainer helps users understand how to define and manage these scripts. Additionally, the Trainer covers UI elements such as modal dialogues, which are vital for handling complex interactions within the T-SQL.APP environment. For example, using the 'sp_api_modal_button' stored procedure, the Trainer guides users on how to collect inputs from modal buttons and apply logic based on these inputs. A scenario would involve creating a modal that collects user inputs to trigger different actions, depending on the selected values.

Main Functions of TSQL APP Action Script Trainer

  • Creating Action Scripts for Card Buttons

    Example Example

    Each button on a card can trigger a unique action defined by a corresponding SQL script stored in the [api_card_actions] table. For instance, a 'Generate Report' button could invoke a script that gathers data and creates a downloadable Excel report.

    Example Scenario

    An employee clicks the 'Generate Report' button on a sales dashboard card. The TSQL APP action script fetches relevant data from the sales table and generates an Excel file using 'sp_api_excel'. The file is then attached to the current card's record.

  • Handling Modal Pages and User Input

    Example Example

    Using the 'sp_api_modal_input' procedure, developers can create modals that prompt users to enter data. The entered data is stored in a variable and can be processed further in the script.

    Example Scenario

    In an inventory management application, clicking 'Update Stock' opens a modal asking the user to input new stock quantities. The input is then validated and used to update the database.

  • Integrating Email Functionalities via sp_api_email

    Example Example

    An advanced example involves sending an email with attachments using the 'sp_api_email' procedure, which supports multiple parameters such as @to, @cc, and @attachments.

    Example Scenario

    A user triggers a 'Send Invoice' action that emails a PDF version of an invoice to the customer. The script generates the invoice, uploads the PDF, and attaches it to the email sent to the customer with a CC to the sales team【14†source】.

Ideal Users of TSQL APP Action Script Trainer

  • SQL Developers

    SQL developers are ideal users because they already have a foundation in SQL and can quickly adopt T-SQL.APP’s extended capabilities for user interaction, file management, and system integration. They will benefit from learning advanced scripting techniques, such as generating Excel reports, managing modal inputs, and sending automated emails directly from the database.

  • Business Analysts and Data Administrators

    Business analysts who work with data-intensive applications and dashboards can benefit from using the Trainer to automate reporting and data processing tasks. They can create scripts that fetch real-time data, generate reports, and trigger automated notifications or emails, improving productivity and decision-making processes.

How to Use TSQL APP Action Script Trainer

  • Visit aichatonline.org for a free trial without login, no need for ChatGPT Plus.

    Access the tool immediately without requiring any login or subscription.

  • Explore documentation and built-in templates.

    Familiarize yourself with the available templates for T-SQL.APP, including creating modal pages and actionscripts.

  • Utilize sample scripts for generating Excel reports or interacting with modals.

    Leverage ready-made examples, such as attaching Excel files to cards or handling modals within a T-SQL.APP project.

  • Test out interactive scripts and modal configurations.

    Use UI elements like buttons and modal forms to capture user inputs and assign variables for action buttons.

  • Implement advanced T-SQL.APP stored procedures.

    For more complex projects, explore advanced procedures such as 'sp_api_email' or 'sp_api_toast' to add custom notifications and email capabilities.

  • Data Export
  • Custom Actions
  • Email Integration
  • Modal Interaction
  • File Attachments

TSQL APP Action Script Trainer - Q&A

  • How do I trigger actions using modal buttons in T-SQL.APP?

    In T-SQL.APP, modal buttons don’t directly execute actionscripts. Instead, they assign a value using the `@value` OUT parameter of `sp_api_modal_button`, which the script can then react to.

  • Can I attach an Excel file to a card using T-SQL.APP?

    Yes, you can create an Excel file from data using `sp_api_excel` and attach it to the current card using the card's context and ID parameters. The `@url` OUT parameter provides the download link【13†source】.

  • What’s the difference between card action buttons and modal buttons?

    Card action buttons are mapped to scripts in `[api_card_actions]` and execute directly when clicked. Modal buttons, however, assign values that the script uses to continue logic【15†source】.

  • How do I send an email with attachments using `sp_api_email`?

    You can send an email with attachments in JSON format by specifying the file path and email parameters like `@to`, `@cc`, `@subject`, and `@attachments`. Complex formats and error handling are supported【14†source】.

  • What’s the use of `sp_api_toast` in T-SQL.APP?

    `sp_api_toast` is used to display visual notifications (toasts) on the screen and can provide auditory feedback using `@speech` and `@speech_lang` parameters【15†source】.