This article explains the full process of retrieving table data into a workflow and using that data to power widgets.
In Rayven.io, widgets are interface components used to display dynamic data from your solution. When using tables as a data source, the recommended approach is to use a Query Table node inside a workflow. This workflow fetches data from the table, processes it if needed, and then connects the results to a widget in your dashboard or app.
Overview: Why Use a Workflow with Query Table
Rayven tables (primary or secondary) store structured data such as asset records, thresholds, logs, or categorized metrics. To use this data in a widget:
-
The Query Table node is used to fetch relevant rows from the table.
-
Optional logic nodes filter, transform, or group the data.
-
The processed result is passed to a widget in a dashboard or interface.
This setup ensures that data is consistently controlled, filtered, and updated.
Step 1: Set Up the Table
Start by confirming that your data table is ready:
-
Columns are clearly labeled and typed (e.g., string, decimal).
-
Data is populated either manually, by import, or by workflows.
-
You know what fields are needed for display in your widget.
Example Table Schema:
-
Device_ID
-
Temperature
-
Status
-
Site_Name
Step 2: Build the Workflow
A. Add the Query Table Node
-
Open the Workflow Builder.
-
Drag in the Query Table node.
-
Select the target table.
-
Define any filters to retrieve only the rows you want (e.g.,
Status = Active
, orSite_Name = Sydney
).
This node acts as your data gateway from the table.
B. Add Optional Logic
Depending on the widget's purpose, insert logic blocks to:
-
Filter by additional conditions
-
Group or aggregate data (e.g., average temperature by site)
-
Sort or limit the result set
-
Clean or rename fields for clarity in the widget
This transforms raw table data into widget-ready output.
C. Output to Widget
-
Add an Output Node or bind the final result set to an interface or dashboard component.
-
In the dashboard builder, connect your widget to the workflow output.
-
Map the widget fields to the output data fields (e.g., map
Temperature
to a KPI or chart Y-axis).
Step 3: Enable Refresh or Trigger Logic
Workflows with Query Table nodes can be:
-
Triggered manually
-
Triggered on a schedule (e.g., every 10 seconds, every hour)
-
Triggered by external events (e.g., form submission, user input)
Choose the triggering method based on how often your data changes and how frequently the widget should be updated.
Example Use Case: Live Device Status View
Objective: Display a real-time table of devices that are currently active.
Steps:
-
Table:
Device_Registry
with fieldsDevice_ID
,Status
,Last_Updated
,Site_Name
-
Workflow:
-
Query Table node filters
Status = Active
-
Sorts by
Last_Updated
descending -
Outputs to table widget
-
-
Widget:
-
Configured as a Table
-
Fields:
Device_ID
,Site_Name
,Last_Updated
-
Auto-refreshes every 30 seconds
-
The result is a live view of currently active devices pulled directly from the table via workflow.
Best Practices
-
Always use the Query Table node when working with table data in workflows.
-
Apply filters in the Query Table node to avoid retrieving unnecessary records.
-
Use intermediate logic to format or restructure the data before it reaches the widget.
-
Test your workflow output before binding it to the widget to ensure correct formatting.
-
Schedule workflow refreshes based on how often the underlying data changes.
Q&A
Q: Can I connect a widget directly to a table?
A: No. In Rayven, widgets must receive data from workflows. Use a Query Table node inside a workflow to retrieve table data, then send it to a widget.
Q: What happens if I update the table — will the widget reflect changes?
A: Yes, as long as the workflow is set to re-query the table. You can trigger it manually, on a schedule, or based on events to ensure fresh data is retrieved and sent to the widget.
Q: Can I use the same table for multiple widgets?
A: Yes. You can build multiple workflows with different Query Table configurations to display different filtered or grouped data from the same source table.
Q: Can I filter table data in the workflow based on user input?
A: Yes. You can pass parameters from dashboards (e.g., selected site or device type) into the workflow and use them in the Query Table node to dynamically filter data.
Q: What’s the difference between using a table directly and using a workflow to power a widget?
A: A table alone doesn’t provide logic or control. The workflow allows filtering, transformation, and event-based updates, which are necessary for real-time or customized widget behavior.