Configuring a Firestore Task in Application Integration

Hi there!

I'm having a lot of trouble trying to make the firestore connector task work. I have a sub-integration where I receive a JSON for each iteration in a list and I need to write that object into one collection of Firestore.

The connector task config is as follows:

Step 1, region and connection are correctly chosen.

Step 2 - Type: I selected Actions.

Step 3 - I chose the action "firestore.projects.databases.documents.write"

 

I didn't find the place to put the collection name where the objects must be written.

When I put the integration to run, I get the error:

Viewing: ErrorMessage

'{"error":{"code":400,"message":"Illegal character in path at index 36: https://firestore.googleapis.com/v1/{database}/documents:write","status":"INVALID_ARGUMENT"}}' eventMessages without params: '[name: "onfly-gravaFireStore" event_info_id: "6b4a8f90-d22b-44d8-9fc9-b2ce09984f07" trigger_id: "api_trigger/onfly-gravaFireStore_API_1" client_id: "796106210514" execution_state: FAILED cloud_logging_details { } event_bus_status: ACTIVE snapshot_number: 1 workflow_origin: UI ]' error/code: 'common_error_code: INVALID_PARAMETER'
 
===========================
 
Where am I able to tell which database the connector should use?
 
Thanks in advance!
Erich
2 REPLIES 2

Hi @erichmonch 

I think operation you are looking for is "firestore.projects.databases.documents.createDocument" action instead of "firestore.projects.databases.documents.write". Can you please select that action as shown in screenshot below.

Screenshot 2024-06-18 at 7.11.23 AM.png

 

Thanks,

Deepa

Also , regarding where to specify the database in the "firestore.projects.databases.documents.write" , if you look at the schema of the connector task , it has to be specified as path parameters.

 

```  "Path parameters": {
"type": "object",
"properties": {
"database": {
"type": "string",
"description": "Required. The database name. In the format: `projects/{project_id}/databases/{database_id}`."
}
}
}, ```

 

Your input to the connector task will be something like this 

```

{

  "Path parameters": {

    "database": "projects/my-project-id/databases/my-database-id"

  },

  "Headers": {

    "x-goog-request-params": "project_id=my-project-id&database_id=my-database-id"

  }

} ```

Thanks