Mastering Variables
Unlock dynamic and reusable workflows by effectively using variables in Jsonify.
Variables are a cornerstone of creating dynamic, reusable, and scalable automations in Jsonify. They allow you to run the same workflow logic with different inputs, personalize actions, and manage data flow effectively.
What are Variables in Jsonify?
In Jsonify, a variable is essentially a named placeholder for a piece of data that can change. When the workflow runs, the placeholder is replaced with its actual value for that specific run or iteration. Variable names are case-sensitive.
Why Use Variables?
- Reusability: Build a generic workflow and use variables to adapt it to different specific inputs without duplicating the entire workflow.
- Dynamic Operations:
- Open different URLs based on a list.
- Perform searches with varying keywords.
- Instruct data extraction based on changing criteria.
- Personalize interactions (e.g., typing a specific username).
- Data Input: Easily feed lists of data (e.g., from a CSV, or typed in) into your workflow using the
Apply Variables
block. - Data Chaining: Use data extracted by one
Extract Data
block as a variable input for subsequent blocks within the same processing loop (e.g., for each item in a list).
Defining Variables: The Apply Variables
Block
The primary way to introduce a list of varying inputs into your workflow is through the Apply Variables
block.
- Columns as Variable Names: Each column header you define in the
Apply Variables
table becomes a variable name (e.g.,company_name
,product_url
,search_keyword
). Remember, these names are case-sensitive. - Rows as Value Sets: Each row in the table represents a distinct set of values for these variables. The workflow (or the part of it following
Apply Variables
) will run once for each row. - Special Column Name
URL
: If you name a column exactlyURL
(case-sensitive) in theApply Variables
block and provide valid, complete URLs (starting withhttp://
orhttps://
) in its rows, the AI Agent will automatically open each of these URLs. In this specific case, a subsequentOpen Websites
block is not required to open these particular URLs. For any other column name intended to hold URLs that you want to open via theOpen Websites
block, ensure the values are complete URLs.
Refer to the detailed guide on the Apply Variables
block for configuration specifics. (We’ll replace #
with the actual link later)
Using Variables in Other Blocks
Once defined (e.g., in Apply Variables
), you can use these variables in most other blocks that accept text input for their configuration.
- Syntax: Variables are referenced using double curly braces:
{{variable_name}}
.- Make sure the
variable_name
inside the braces exactly matches the column header fromApply Variables
(including case).
- Make sure the
- Common Use Cases:
Open Websites
:- URL:
https://{{website_domain}}/products
(assumingwebsite_domain
provides just the domain likeexample.com
)
- URL:
Search on Google
:- Query:
reviews for {{product_name}}
- Query:
Interact with Page
:- Action:
type {{user_comment}} into 'comment_field'
- Action:
click button 'Download {{report_filename}}'
- Action:
Extract Data
(in Descriptions or Additional Instructions):- Description for a field:
Extract the price for the item named {{item_name}}.
- Additional Instruction:
Only extract reviews that mention the brand {{brand_to_filter_by}}.
- Description for a field:
Find Links
:- Description:
Find the link to the contact page for {{company_name}}
- Description:
Variables from Extract Data
Output
When you use an Extract Data
block, the NAME you give to each attribute (e.g., product_title
, reviewer_name
) can act as a variable for subsequent blocks within that same iteration or loop. These are also case-sensitive.
- Example:
Open Websites
(opens a category page)Find Links
(finds links to all product pages, e.g., outputsproduct_page_url
)Follow Links
(configured to “Follow each link”product_page_url
)- Now, for each product page visited:
Extract Data
(extractsproduct_name
andprice
from the current product page)Search on Google
(can use{{product_name}}
from the previous step:Search for 'competitors of {{product_name}}'
)
This allows you to chain operations based on data extracted in real-time.
Tips for Naming Variables
- Descriptive: Choose names that clearly indicate what the variable represents (e.g.,
customer_email
instead ofeml
). - Consistent: Use a consistent naming convention (e.g.,
snake_case
likeproduct_id
, orcamelCase
likeproductId
). Remember case sensitivity. - Avoid Spaces and Special Characters (other than underscore): Stick to letters, numbers, and underscores for maximum compatibility and clarity.
Scope of Variables
Apply Variables
Scope: Variables defined inApply Variables
are available to all subsequent blocks for each iteration (row) defined in theApply Variables
block.Extract Data
Scope: Variables created fromExtract Data
field names are scoped to the current item being processed in a list or the current page for that specific iteration.
Understanding and effectively utilizing variables will dramatically increase the flexibility and power of your Jsonify workflows, allowing you to automate more complex and varied tasks with less effort.