Connector for Firestore (write)

Stay organized with collections Save and categorize content based on your preferences.

Writes to Firestore using a Workflows connector.

Code sample

YAML

- init_variables:
    assign:
      - project: ${sys.get_env("GOOGLE_CLOUD_PROJECT_ID")}
      - collection: "peopleDatabase"
      - document: "smith.j"
      - values_to_write:
          FirstName:
            stringValue: "John"
          LastName:
            stringValue: "Smith"
          Age:
            integerValue: 32
- write_to_firestore:
    call: googleapis.firestore.v1.projects.databases.documents.patch
    args:
      name: ${"projects/"+project+"/databases/(default)/documents/"+collection+"/"+document}
      body:
        fields: ${values_to_write}
    result: write_result
- last:
    return: ${write_result.name}

What's next

To search and filter code samples for other Google Cloud products, see the Google Cloud sample browser.