Firebase Database Action

Use this action to insert, update, delete or retrieve one or more Firebase cloud documents from your Firebase account.

Settings

The action uses the following settings:

Remarks

When requesting or uploading a full Firebase document, Xenioo will automatically translate each model into a simpler representation that will both speed up parsing and simplify representation.

As an example, let's have a look at the following Firebase Firebase document:

{
    "name":"projects/somedb-14cf1/databases/(default)/documents/users/319daACFaz",
    "fields"{
        "full_name":{
            "stringValue":"Gian"
        },
        "age":{
            "integerValue":"48"
        }
    }
}

As you can see it's very complete, but also quite verbose and not very handy for quick variables reading. When accessing this document, Xenioo will automatically shrink the structure to a more concise version:

{
    "Id":"319daACFaz",
    "full_name":"Gian",
    "age":48
}

Note two things: first, the document id has been reduced to represent only the actual document final unique value. Second, the age field has been automatically translated in the projected model to the correct type, representing a number.

The same translation happens also in reverse. When using the second model to update a Firebase document, Xenioo will transform back the model to the Firebase format. Note that this is not mandatory: the Firebase Action supports both the default, Firebase native format and the Xenioo translated one.

When using QUERY mode, a full structured query can be specified inside the Query Payload parameter. As an example, searching for a document where the field "FirstName" is equal to "Mary" would require a query like this:

where:{
    fieldFilter:{
        field:{
            fieldPath:"FirstName"
        },
        op:"EQUAL",
        value:{
            stringValue:"Mary"
        }
    }
}

All of the actions that can be executed by this action can also be executed directly by code, using specific methods available in Xenioo Cloud Scripting Action.

To avoid overload, when no filter is active, the action will not query all the records available in a given collection. Only the first 20 fields will be extracted. Do not use the LIST mode to access the full list of records and then search manually. Use a structure

Trigger

This action does not trigger any event.

Variables

Beside the value set to the selected Target Variable setting, this action is producing the following variables:

Availability

Channel specific availability follows the table below:

This action can be used only inside interactions and not as child of other actions. This action requires a Premium Account to be used on a live chatbot.

Further Reading

Last updated