Search code examples
jsongoogle-cloud-firestorezapier

how to get the field name of the forms section that I have in firestore to run a json request


im working with zapier.com to make a conection between firestore collection to google docs, there is a part to make a StructuredQuery where im getting the 400 error, because he seems not to find the field

I have tried to change the syntax many times, but it seems not to work

the JSON part:

{
 "orderBy": [{
        "id": {
         "fieldPath": "title"
        },
        "direction": "DESCENDING"
    }]
}

it sends me this:

We had trouble finding a sample.
Error code 400: [{

  "error": {
    "code": 400,
    "message": "Invalid JSON payload received. Unknown name \"id\" at 'structured_query.order_by[0]': Cannot find field.",
    "status": "INVALID_ARGUMENT",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.BadRequest",
        "fieldViolations": [
          {
            "field": "structured_query.order_by[0]",
            "description": "Invalid JSON payload received. Unknown name \"id\" at 'structured_query.order_by[0]': Cannot find field."
          }
        ]
      }
    ]
  }
}
]    

the firebase part that i try to reach


Solution

  • the solution for anyone that found this helpfull

    {
     "orderBy": [{
             "field": {    
                        "fieldPath": "id"
                    },
            "direction": "DESCENDING"
        }]
    }