Setup

Create Custom Variables

Estimated reading: 3 minutes

Here’s a step-by-step tutorial based on how to create and use variables in FlowMattic.

Step-by-Step Guide: Creating a Custom Variable in FlowMattic

Step 1: Navigating to the Variables Section

  1. Login to FlowMattic and access your dashboard.
  2. In the left-hand menu, click on “Variables”.
  • This will take you to the Variables Management screen where you can see a list of previously created variables or create new ones.

Step 2: Creating a New Variable

  1. On the Variables screen, click on the “Add New Variable” button (usually located at the top of the page).
  2. A form will appear, prompting you to fill in the details for the new variable.
  • Variable Name:
    • Enter a unique and meaningful name for your variable (e.g., current_time or user_id).
  • Variable Value:
    • This field accepts a plain text value, dynamic placeholders, or even a PHP function. For example:
    • Entering PHP:time() as the value will dynamically call the time() function whenever this variable is accessed in your workflow, returning the current Unix timestamp.
    • Similarly, you can use other PHP functions like PHP:date("Y-m-d") to return a formatted date.

Step 3: Using PHP in Variables

  • FlowMattic supports PHP functions directly in the Variable Value field, which is extremely useful for dynamically generating data.
  • Example:
  • If you input PHP:time() as the variable value, FlowMattic will evaluate the PHP code when the variable is accessed in the workflow.
  • This ensures that the value is always current and generated at runtime.

Step 4: Saving the Variable

  1. After entering the Variable Name and Variable Value, click on “Save” or “Create”.
  • Your variable will now appear in the list of available variables, and its value will be updated each time it is accessed in workflows.

Step 5: Using the Variable in a Workflow

  1. Navigate to the Workflows section of FlowMattic.
  2. When creating or editing a workflow, locate the step where you wish to use the variable.
  • Most fields that accept dynamic data (such as messages, emails, or API requests) will allow you to insert variables.
  1. Click the “Database” icon or in the input field to bring the dynamic data dropdown, then find the variable in the “Variables” toggle. OR type the variable name (e.g., {{variable_name}}) where you want to use the variable.
  • If you created a variable with a PHP function (e.g., PHP:time()), this function will be called and evaluated dynamically when the workflow is triggered.

Step 6: Testing Your Variable

  1. Run your workflow and check the output to ensure that the variable works as expected.
  • For example, if you used the PHP:time() function, the workflow should output the current Unix timestamp wherever you used the variable.

Example Use Case

  • Current Timestamp Variable:
  • If you create a variable current_time with the value PHP:time(), you can use this variable in an email, API request, or other workflow step to always have the exact timestamp when the workflow runs.
  • Formatted Date Variable:
  • If you want the current date in YYYY-MM-DD format, you can create a variable with the value PHP:date("Y-m-d").

Conclusion

By following these steps, you can effectively create and manage custom variables in FlowMattic, using PHP functions for dynamic and real-time data processing in your workflows. This is especially useful for automating tasks that rely on up-to-date information like timestamps, dates, or other PHP-based calculations.

Share this Doc

Create Custom Variables

Or copy link

CONTENTS

How to Embed Table on Frontend of your website?

Displaying tables on the frontend of your website is an excellent way to share s

License Activated, but Still Shows Not Active on Integrations Page

If you’ve activated your FlowMattic license but still see a “License

Delay or Scheduled Workflows not working

If your delayed or scheduled workflows in FlowMattic are not working as expected

Webhook not capturing response

If your webhook is not capturing a response in FlowMattic, there could be a vari

Number Formatter by FlowMattics

FlowMattic’s Number Formatter is a versatile tool designed to handle various num

Webpage Parser by FlowMattic

FlowMattic’s Webpage Parser is a versatile tool designed to streamline the proce

XML Parser By FlowMattic

FlowMattic’s XML Parser is an essential tool designed to streamline data integra

CSV Parser by FlowMattic

The CSV Parser by FlowMattic is a powerful tool designed to help users effortles

Counter by FlowMattic

The Flowmattic Counter is a versatile feature designed to track and manage numer

Tables by FlowMattic

Step 1: Set the Database Location The first thing you need to do to use the Tabl

Understanding the Status Page

FlowMattic Status Page The FlowMattic Status Page provides an overview of the cr

Setting up FlowMattic Connect for X ( Twitter ) integration

In this article, we will guide you through the process of setting up the FlowMat

Chat Icon Close Icon
Scroll to Top