The integration with Fracttal Hub facilitates the controlled incorporation of new equipment into the platform, ensuring that the data follows a standardized structure. This guide explains how to set up a secure flow to create equipment in Fracttal One using a spreadsheet as the data source.
The connection will be established using a Service Account from Google Cloud Platform, which is the recommended method for server-to-server integrations, ensuring security and autonomy.
Stage 1: Setup in Google Cloud Platform (GCP)
The first step is to create the necessary credentials in the Google platform to allow Fracttal One to securely access your sheet.
1.1. Access the service account
- Access the Google Cloud Platform Console.
- In the navigation menu, go to APIs & services > Credentials.
- Click on + CREATE CREDENTIALS and select the option Service Account.
- Complete the following fields:
- Service Account Name: Assign a descriptive name.
- Service Account ID: Generally generated automatically from the name.
- Click on "Done" to finish creating the credential.
Once created, it will be necessary to enable it so that it can be used in the integration processes.
1.2. Generate the Access Key (JSON)
- On the Credentials screen, locate the newly created service account and click on its email address.
- Go to the KEYS tab.
- Click on ADD KEY and select Create new key.
- Choose the type JSON (recommended) and click on CREATE.
- A
.jsonfile will automatically download to your computer. Save it in a secure place, as it contains the access credentials and will be needed in Stage 3.
Stage 2: Preparing the Google Sheets
Now we will prepare the sheet that will serve as the data source.
- Open your Google Sheets.
Header structure:
In the first row, ensure that the column names exactly match the parameters required by the Fracttal API for asset creation. The required fields are:
code: Unique asset code.id_type_item: Numeric ID of the asset type (for example:2for Equipment, according to the API documentation).field_1: Corresponds to the Name of the asset.
| code | id_type_item | field_1 |
|---|---|---|
| HUB-001 | 2 | SUV TRUCK |
Share the sheet:
It is crucial to grant access permission to the Service Account we created.
- In GCP, copy the email of your service account.
- Return to the spreadsheet, click on Share.
- Paste the email in the share field.
- Assign the Editor permission.
Click on Send/Share.
Stage 3: Setting up the connection in Fracttal One
With the credentials and the sheet ready, we will set up the communication bridge within Fracttal One.
- In Fracttal One, navigate to Settings > Auxiliary Catalogs.
- In the catalog selector, choose Connections.
- Click on the + icon to add a new connection.
Configure the following fields:
- Type: Select Google Sheet (Service Account).
- Description: Enter a clear name for this connection, for example,
CREATE EQUIPMENT.
Complete the credentials:
Open the .json file downloaded in Stage 1.2 and copy and paste the content of each field into the Fracttal One form:
private_keyclient_emailclient_idclient_x509_cert_url- ...and the other required fields.
Click on Save.
Stage 4: Create the flow in the Automator (Fracttal Hub)
Finally, we will create the automation flow that will read the data and create the assets.
- Go to the main menu and select Automator > Fracttal Hub.
- Click on the + icon to create a new flow.
- Assign a name to the flow.
4.1. Configure the Source
Trigger
For this example, select Manual. This allows you to run the flow whenever you want.
Source:
- Module: Select
GoogleSheet. - Connection: Select the connection created in Stage 3 (
CREATE EQUIPMENT). - Action: Select
Read. - spreadsheet_id: Paste the ID of your sheet. You can find it in the URL (the long code between
/d/and/edit). - sheet: Enter
0to read the first tab (numbering starts at 0). - Fields: Add the header names from your sheet (
code,id_type_item,field_1).
4.2. Configure the Destination
Connection:
- Module: Select
Fracttal. - Connection: Select
FRACTTAL HUB. - Action: Select
Update or create an asset.
Configuration
- Click on the gear icon (Settings).
- Map the source fields (Google Sheet) with the destination fields (Fracttal API), ensuring they match:
- Click to save the mapping and then on Save in the upper right corner to save the entire flow.