With the automation option in Fracttal Hub, it is possible to efficiently manage the creation and updating of meters without manual intervention, especially in high data volume contexts. This functionality allows users to streamline operational processes and minimize human errors in handling meter readings.
Below, you will find a step-by-step guide on how to set up this functionality within the Fracttal Hub platform.
Step 1: Access the Google Cloud Console
Log in to Google Cloud Console.
- Go to the API and Services > Credentials section.
Click on Create Credentials > Service Account.
- Name the service account as "create_meters" and follow the process until completion.
Step 2: Generate the JSON key
Once the service account is created, select it from the list.
Go to the Keys section. Click on Add Key > Create New Key.
Select the JSON format.
- Save the generated file in a secure location; this file will be necessary to configure the integration in Fracttal Hub.
Step 3: Prepare the spreadsheet (Google Sheets)
Now, we will prepare the spreadsheet that will serve as the data source for the creation of meters.
| description | item_code | unit_code | is_counter |
| Electric Transformer | ABC123-HC-FC | KM | TRUE |
- Create a new spreadsheet in Google Sheets.
- Give it a descriptive name, such as CREATE METER.
- In the first row, define the column headers. These must match the parameters required by the Fracttal API. For this example, we will use the following mandatory fields and one optional:
- Column A: description (Description of the meter, e.g.: "KM Meter").
- Column B: item_code (Code of the asset to which the meter will be associated, e.g.: "HUB-004").
- Column C: unit_code (Code of the meter's unit, e.g.: "KM". This code must exist previously in Settings > Auxiliary Catalogs > Unit).
- Column D: is_counter (Optional, but recommended. Indicates if the meter is a counter. Write TRUE if it is, or FALSE if not).
- Fill the rows with the information of the meters you wish to create.
- Share the spreadsheet: This is a crucial step.
- Copy the email of the service account you created in Step 1 (you will find it inside the .json file in the client_email field).
- Click the Share button on your spreadsheet.
- Paste the email of the service account and assign it Editor permissions.
- Click on Send.
Step 4: Create the connection in Fracttal One
Now we will configure the connection within Fracttal so that it can use the service account credentials.
- In Fracttal, navigate to Settings > Auxiliary Catalogs > Connections.
- Click on the + icon to add a new connection.
- Fill in the following fields:
Type: Select Google Sheet (Service Account).
- Description: Assign a name to the connection:
Open the downloaded
.jsonfile and copy/paste the content of the following fields into their respective places in the Fracttal form:
private_keyclient_emailclient_idclient_x509_cert_url
Click the ✓ icon to save and then click Save.
Step 5: Configure the flow in Fracttal Hub
With the connection ready, the last step is to create the automation flow.
- Navigate to the Fracttal Hub module.
- Click the + icon to create a new flow.
- Add a Description for the flow:
Trigger Configuration:
Click on Trigger and select the type Manual. This allows the flow to be executed whenever desired.
Source Configuration:
Click on Source.
Module: Select
GoogleSheet.Connection: Select the connection created in the previous step.
Action: Select
Read.spreadsheet_id: Copy the ID of your spreadsheet (you can find it in the URL, between
/d/and/edit/).sheet: Write
0to read the first tab.Fields: Add the names of the columns:
Destination Configuration:
Click on Connection in the destination section.
Module: Select
Fracttal.Connection: Choose
FRACTTAL HUB.Action: Select
Create Meters.
Field Settings (mapping):
Click on Settings in the destination section.
Map the fields from the sheet (Source) with those of the system (Destination), ensuring they match:
description ⟵ description
item_code ⟵ item_code
unit code ⟵ unit_code
is_counter ⟵ is_counter
Click on Save to save the flow configuration.
Step 7: Run and verify the flow
Turn on the Enabled switch.
- Click again on Save.
Click the Execute button to start the process.
You can monitor the progress in the Event Queue and Execution History tabs. A successful process will show "Process Completed" and mark the Extraction, Transformation, and Loading stages as complete.