Firebase - Query Document. Help!

Status: Closed · Asked by pulboron on · 0 views

pulboron — Question ·
Task History ID: IjU3NjMwNTY4MDYzMzA0M2M1MjZkNTUzMjUxM2I1MTY1NTQzNiI_3D_pc

Hello, I'm trying to make the Query Document functionality for firebase work. However, I keep on getting this error message:

[{"error":{"code":400,"message":"Invalid JSON payload received. Unknown name \"\": Root element must be a message.","status":"INVALID_ARGUMENT","details":[{"@type":"type.googleapis.com\/google.rpc.BadRequest","fieldViolations":[{"description":"Invalid JSON payload received. Unknown name \"\": Root element must be a message."}]}]}}]

Basically, I have a collection called "Orders" and I want to query the Document IDs given an Order ID and a Order Line ID. If written as SQL, it will be like this:

SELECT DOCUMENT_ID
FROM Orders
WHERE OrderID = '12345' and OrderLineID = '23456'

Can anyone help me make it work?

Arshil Ahmad — Reply ·

Hi @pulboron,

Could you please make a short screen recording elaborating a bit more on your use case? This will allow us to gain a better understanding of your concern.

pulboron — Reply ·

Here you go: screen recording link

Basically my use case is the following:
1. I get all Order Updates from WooCommerce
2. Once I get Order updates, I Query if that order exists in Firebase using 2 columns: OrderID and OrderLineID
3. If it does not exist, Create new document/record in Firebase
4. If it exists, update the existing record in Firebase

Pabblymember11 — Reply ·
Here you go: screen recording link

Basically my use case is the following:
1. I get all Order Updates from WooCommerce
2. Once I get Order updates, I Query if that order exists in Firebase using 2 columns: OrderID and OrderLineID
3. If it does not exist, Create new document/record in Firebase
4. If it exists, update the existing record in Firebase


Kindly try using the Get document action step once and pass all the parameters mentioned in the Document Path then we pass the routers' conditions accordingly.

pulboron — Reply ·

I was able to get it working. Apparently, I needed to include data type in filter value instead of just putting the value there.

Pabblymember11 — Reply ·

Thanks for the update @pulboron

Back to all forum threads · Log in to reply