Grok

Integration with Grok is implemented as a separate Grok block, which can be placed between the Data Source and the Data Destination. This allows you to create a query based on data from the Data Source and transfer data from Grok to the Data Destination fields. This allows you to automatically receive data from Grok and transfer it to the services and systems you use.
This function allows you to analyze data from the Data Source using Grok and transfer the query result to the Data Destination.
Navigation:
Connecting Google Sheets as a Data Source:
1. What data can you get from Google Sheets?
2. How to connect a Google Sheets account to ApiX-Drive?
3. Select the table and sheet from which the rows will be downloaded.
4. An example of data that will be transferred from Google Sheets.
Connecting Grok :
1. What data can be obtained from Grok ?
2. How do I connect my Grok account to ApiX-Drive?
3. How do I configure a Grok data search in a selected action?
Generate IMAGE
Send PROMPT
4. An example of the data that will be transferred from Grok .
Setting up row updates in Google Sheets:
1. What will the Google Sheets integration do?
2. How to connect a Google Sheets account to ApiX-Drive?
3. How do I configure the selected action to transfer data to Google Sheets?
4. Example of data that will be sent to your Google Sheets.
5. Auto-update and communication response interval.
Setting up Data Source: Google Sheets
Let's take a look at how the Grok data query function works and how it transfers the results to Google Sheets.
First, you need to create a new connection.

Select a system as the Data Source. In this case, you need to select Google Sheets

Next, you need to specify the action "Get ROWS (new)".

The next step is to select the Google Sheets account from which the data will be downloaded.
If there are no account connected to the system, click "Connect account".

Select which account you want to connect to ApiX-Drive and grant all permissions to work with this account.




Once the connected account appears in the "active accounts" list, select it for further work.
Attention! If your account is listed as "inactive accounts," please verify your access to this account.

Select the Google Sheets table and sheet where the data you need is located.

If necessary, you can adjust the Data Filter, or click Continue to skip this step.
To learn how to configure the Data Filter, follow the link: https://apix-drive.com/en/help/data-filter

You can now see sample data for one of the rows in your Google Sheets spreadsheet.
If you want to update the test data, click "Load test data from Google Sheets".
If you want to change the settings, click "Edit" and you will go back one step.

Now let's connect the additional AI TOOLS module. To do this, click the "+" button and select "AI TOOLS" from the list.

Setting up Grok
We select "Grok " as the system in which the search will be performed.

- Send PROMPT - allows you to send a request to Grok to generate, edit, and translate data.
- Generate IMAGE - allows you to send a request to Grok to generate an image based on the parameters you specify
Next, you need to specify the action, for example, "Generate IMAGE".

The next step is to select a Grok account.
If there are no account connected to the ApiX-Drive system, click "Connect account".

Enter the API key, which is located in the settings of your Grok personal account.
To get an API key, you need to go to the Grok console at https://accounts.x.ai/sign-in?redirect=cloud-console and log in. After successful login, select API Keys in the left menu and create a new API key by filling in the required data. After that, you can copy your API key and paste it into the appropriate field in ApiX-Drive.
Click Save and select the connected Grok account from the drop-down list.




Once the connected account appears in the "active accounts" list, select it for further work.
Attention! If your account is listed as "inactive accounts," please verify your access to this account.

Now you need to select the Grok Model. The choice depends on your needs.

grok-2-image-1212 is an artificial intelligence model for generating images based on text descriptions. It allows you to create realistic, artistic or graphic illustrations of any complexity based on user prompts.
In this case, only the grok-2-image-1212 model is available.
In the future, after adding other models to Grok, they will also be available for selection in our system.
In this case, select "grok-2-image-1212".

- Prompt – a required field. It is necessary to enter a text description (prompt) on the basis of which the Grok model will generate images. The more precise and detailed the description, the more accurate the result will be.
-Number of images – determines the number of images that will be generated for one prompt. The minimum value is 1, the maximum is 10. This allows you to get from one to 10 image options for your request.


Now you see test data for your request. You can transfer this data to your Data Destination table.
If the test data does not appear automatically, click "Search in Grok ".
If you're not happy with something, click "Edit," go back a step, and change the search field settings.

Example of field settings and test data for the "Send PROMPT" action
You need to select a Grok model. The choice depends on your needs.

-grok-2-1212 — basic Grok model for working with text. Used to create answers to text queries, analyze text, generate content of medium complexity and work with dialogues.
-grok-2-vision-1212 — Grok model with support for image processing. Allows you to analyze images, generate a description for an image or create multimodal answers based on text and images.
-grok-3 — powerful Grok model for working with text of high complexity. Used to generate long texts, complex analytical answers, create scenarios, summaries and other tasks that require deep context.
-grok-4-0709 — the latest version of the Grok 4 model. Increased accuracy and depth of understanding of the text, improved ability to contextual analysis and complex logical tasks.
And other models.
In this case, select "Grok-2-1212".

-Prompt - in this field you need to assign in which variable of the Data Sources table the data for which the query will be made on the Grok server is located, in our case it is column "A".
- Maximum tokens - is the number of words up to which the generation in Grok will continue. 1000 tokens - 750 words.
-Temperature - can take values from 0 to 2. Higher values, such as 2, will make the conclusion more random, and lower values, such as 0, will make it more focused and deterministic.
-Frequency penalty - can take values from -2 to 2. Higher values reduce the repetition of words in the text, making it more diverse. Lower values allow repetition of words, which can be useful for certain styles of text.
-Presence penalty - can take values from -2 to 2. Higher values stimulate the model to add new words and ideas, avoid repetitions. Lower values allow you to repeat already used words and phrases, making the text more consistent.



Now you see test data for your request. You can transfer this data to your receiving table.
If the test data does not appear automatically, click "Search in Grok ".
If you're not happy with something, click "Edit," go back a step, and change the search field settings.



This completes the Grok data setup!
Now we can begin setting up Google Sheets as a Data Destination system.
To do this, click "Data Destination".

Setting up Data Destination: Google Sheets
Select the system for Data Destination. In this case, you need to select Google Sheets.

Next, you need to specify the action "Update ROW".

The next step is to select the Google Sheets account to which the Grok query results will be transferred. If this is the same account, select it.
If you need to connect another account to the system, click "Connect account" and repeat the same steps, described when connecting Google Sheets as a Data Source.

Now you need to select the File (Table) and Sheet in which the search result will be updated in Grok .
In the "Search Column" field, select the column by which to search for data. This means where to look for data in the table.
Next, in the "What to Search" field, you need to select a variable from the drop-down list or enter the data manually. This is the value the system will search for to update the row you need. In our case, we'll select column "A," which contains the request data. The system will update the data in the required row only if it matches the requested data.
You also need to specify the Search Type in case multiple lines with the same query are found:
"First found row" - data search and updating will occur in the first found row that satisfies the search conditions.
"Last found row" - the search and update of data will occur in the last found row that satisfies the search conditions.
"All found rows" - the search and data update will occur for all found rows that meet the search conditions.
Now you need to assign the variable containing the query result, which we retrieve from the AI Tools block, to the empty column. This column will subsequently be updated with data based on your query.
After setting up, click "Continue".




Thus, the Grok block takes the field in the Data Source in which you have written the query text, queries the Grok server for the result of this query and transfers this data to the Data Destination field, for example, to column "H".




This completes the Data Destination system setup!
Now you can proceed to choosing the update interval and enabling automatic updates.
To do this, click "Enable update".

On the main screen, click the gear icon to select the desired update interval or set up Scheduled Run. To schedule the connection, select Scheduled Run and specify the desired connection update time, or add multiple times at once.
Important! For the Scheduled Start to run at the specified time, the interval between the current time and the specified time must be more than 5 minutes. For example, if you select 12:10 PM and the current time is 12:08 PM, the automatic connection update will occur at 12:10 PM the next day. If you select 12:20 PM and the current time is 12:13 PM, the automatic connection update will occur today and every day thereafter at 12:20 PM.
To make the current connection trigger after another connection, check the "Update only after connection" box and specify the connection after which the current one will trigger.


To enable auto-update, move the slider to the position shown in the figure.
To force a connection, click on the arrow icon.

This completes the Grok Data Search setup! It's quite simple!
Now you don’t have to worry, ApiX-Drive will do everything else on its own!