Skip to content

Commit e187d75

Browse files
Update mendix-data-loader.md
1 parent 9d997b7 commit e187d75

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

content/en/docs/appstore/use-content/platform-supported-content/modules/snowflake/mendix-data-loader.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,38 @@ To view all ingestion jobs associated with a specific data source in Snowflake,
9696
SELECT * FROM core.ingestion_job WHERE DATASOURCE_ID = '1234abcd' ORDER BY CREATED_DATE_TIME DESC;
9797
```
9898

99+
## Programmatically Trigger an Ingestion From a Mendix App
100+
101+
Programmatically triggering an ingestion job can meet data ingestion requirements where a scheduled task may not. This includes cases such as waiting for a last submission to be submitted to a Mendix app before data ingestion occurs. Another example case is to start data ingestion when the load on the Mendix app is the lowest.
102+
103+
### Prerequisites
104+
- A fully configured data source in the Mendix Data Loader
105+
- A Mendix app equipped with the Snowflake REST SQL connector
106+
- An authenticated user that is allowed to trigger stored procedures
107+
108+
To trigger an ingestion job programmatically, use the `ExecuteStatement` operation available in the Snowflake REST SQL connector. The statement to be executed has the following syntax.
109+
110+
```sql
111+
CALL {NAME_OF_THE_MENDIX_DATA_LOADER}.MX_FUNCTIONS.RUN_INGESTION_JOB('{DATASOURCE_ID}','{TASK_ID}');
112+
```
113+
114+
- The default name for the Mendix Data Loader is `MENDIX_DATA_LOADER`
115+
- Data source ID is a required parameter
116+
- Task ID is an optional parameter
117+
118+
To find the data source ID for a given data source:
119+
1. Navigate to the Snowflake environment
120+
2. Open the Mendix Data Loader; Data Products -> Apps -> Mendix Data Loader
121+
3. Open the application by clicking the `MENDIX_DATA_LOADER` tab
122+
4. Click *View* on the configured data source
123+
5. Copy the value for the `ID` key
124+
125+
For a data source with the ID *40FJYP9D*, the resulting statement will be.
126+
127+
```sql
128+
CALL MENDIX_DATA_LOADER.MX_FUNCTIONS.RUN_INGESTION_JOB('40FJYP9D','');
129+
```
130+
99131
## Verifying the Access Token
100132

101133
When using OAuth authentication with the Mendix Data Loader, it is crucial to verify the access token received by your Mendix application. This verification process ensures the token's authenticity and integrity, protecting your application from unauthorized access attempts.

0 commit comments

Comments
 (0)