# How to search through Flow Builder Logs

There are several cases where you might want to filter out a specific end user's journey in [Flow's Logs](https://support.messagebird.com/hc/en-us/articles/9230747907089).

Dive into the following few lines to discover how to perform a couple of them.

#### Table of contents <a href="#id-01gdd5r2bhjv6z57p18c5qrkt7" id="id-01gdd5r2bhjv6z57p18c5qrkt7"></a>

* [Example 1: Search for a phone number](#01GE1R1DTXPCB4BQZ4F1X51YKR)
* [Example 2: Search for an error](#01GE1R1M8XCY96NQKNZB8D9C6V)
* [Example 3: Search for a custom variable](#01GEKWPXKJANWG42W5A0V46V7A)
* [Example 4: Search based on if a step has been executed or not](#01GG9RJHK3QNYJ8V15DDSF6XR4)
* [Example 5: Search to determine if an end-user dropped off from a chatbot Flow](#01GHXV1GP7ZDQPWVBSQT2M7SKT)

#### Before getting started <a href="#id-01gdd5qwrmbnqm2ec5jyaek5pf" id="id-01gdd5qwrmbnqm2ec5jyaek5pf"></a>

You will need:

* A [MessageBird account](https://dashboard.messagebird.com/)

**Example 1: Search for a phone number or display name**

There are cases when one of your end users might come to you complaining that they have not received a message you have sent. You would want to filter out that specific user, either by contact number or their display name, to check logs of invocations relating specifically to them:

**1)** Visit the Flow

**2)** Navigate to its Logs:

<figure><img src="https://675349995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUJNEE9TMK4fU91VKstBr%2Fuploads%2Fgit-blob-815618ef7a4138f550a1e05d4eeca99098c03cba%2FLogs.jpg?alt=media" alt=""><figcaption></figcaption></figure>

**3)** Select the timeframe you would like to apply for your search:

<figure><img src="https://675349995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUJNEE9TMK4fU91VKstBr%2Fuploads%2Fgit-blob-823311c6bac99d5f7c87451cd0040f7340f3c70b%2FTimeframe.jpg?alt=media" alt=""><figcaption></figcaption></figure>

**4)** Add a filter of a *variable* and write in the name *contact.phoneNumber* to search by number or *contact.displayName* to search by display name:

<figure><img src="https://675349995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUJNEE9TMK4fU91VKstBr%2Fuploads%2Fgit-blob-918886fe73771b97e616be688f5bb31f4f209538%2FdispayName.gif?alt=media" alt=""><figcaption></figcaption></figure>

Results of this search will be specific invocations involving the end user complaining.

**Example 2: Search for an error**

**Another scenario is one where you would like to search for a specific error:**

**1)** Visit the Flow

**2)** Navigate to its Logs:

<figure><img src="https://675349995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUJNEE9TMK4fU91VKstBr%2Fuploads%2Fgit-blob-815618ef7a4138f550a1e05d4eeca99098c03cba%2FLogs.jpg?alt=media" alt=""><figcaption></figcaption></figure>

**3)** Select the timeframe you would like to apply for your search:

<figure><img src="https://675349995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUJNEE9TMK4fU91VKstBr%2Fuploads%2Fgit-blob-823311c6bac99d5f7c87451cd0040f7340f3c70b%2FTimeframe.jpg?alt=media" alt=""><figcaption></figcaption></figure>

**4)** Add a filter of *failure details* and write in the error description or code you would like to know more details on, ex.: *code 21*:\ <br>

<figure><img src="https://675349995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUJNEE9TMK4fU91VKstBr%2Fuploads%2Fgit-blob-ab514f61199751544976bb7b00e8014ec62f0233%2Ferror.gif?alt=media" alt=""><figcaption></figcaption></figure>

With this search, you can pinpoint specific invocations containing the error and examine further by clicking on an invocation.

**Example 3: Search for a custom variable**

**Search enables you to filter out any custom variable you might be using in your Flow:**

**1)** Visit the Flow.

In this example, we have a Flow that has a set variable of *flowURL* and we would like to filter out all invocations containing it. For that we will use the flow ID contained in the URL: *91d37495-f144-43ce-8935-a1d07ae86b24*:

<figure><img src="https://675349995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUJNEE9TMK4fU91VKstBr%2Fuploads%2Fgit-blob-13e964f2ddf5cc2a82b39763902559c36ae3ef5c%2F9627727519761?alt=media" alt=""><figcaption></figcaption></figure>

**2)** Navigate to its Logs:

<figure><img src="https://675349995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUJNEE9TMK4fU91VKstBr%2Fuploads%2Fgit-blob-815618ef7a4138f550a1e05d4eeca99098c03cba%2FLogs.jpg?alt=media" alt=""><figcaption></figcaption></figure>

**3)** Select the timeframe you would like to apply for your search:

<figure><img src="https://675349995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUJNEE9TMK4fU91VKstBr%2Fuploads%2Fgit-blob-823311c6bac99d5f7c87451cd0040f7340f3c70b%2FTimeframe.jpg?alt=media" alt=""><figcaption></figcaption></figure>

**4)** Add a filter of *variable* and write in the name of the custom variable and the text (flow id in this case) it contains:

**Example 4: Search based on if a step has been executed or not**

When the goal of your search is to determine if a step in your Flow has been executed or not, the way to accomplish it is by searching for a variable output of a specific step.\
To give you an idea, the *Create Inbox ticket* step has its set of variables that are generated by it:

* `inboxTicketNumber`
* `inboxTicket` object variable with details from an Inbox ticket
* `inboxCreateTicketStatus`

Similarly, other steps have their own output of variables. \
If you search for any of those variables with the condition of *present*, you will be able to filter any invocation that contains them. In turn, if there are no results from such a search, the step has not been executed.

Let's see how to search:

**1)** Visit the Flow

**2)** Navigate to the step you wish to filter out and open its configuration panel by clicking on the step:<br>

<figure><img src="https://675349995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUJNEE9TMK4fU91VKstBr%2Fuploads%2Fgit-blob-89b0e21a0e95d7bc473ef1c7a74dccfa540778fd%2F10140825186065?alt=media" alt=""><figcaption></figcaption></figure>

**3)** Go to the Flows Logs:

<figure><img src="https://675349995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUJNEE9TMK4fU91VKstBr%2Fuploads%2Fgit-blob-815618ef7a4138f550a1e05d4eeca99098c03cba%2FLogs.jpg?alt=media" alt=""><figcaption></figcaption></figure>

**4)** Select the timeframe you would like to apply for your search:

<figure><img src="https://675349995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUJNEE9TMK4fU91VKstBr%2Fuploads%2Fgit-blob-823311c6bac99d5f7c87451cd0040f7340f3c70b%2FTimeframe.jpg?alt=media" alt=""><figcaption></figcaption></figure>

**5)** Add a filter of a *variable*, write the name of the specific variable from the step and add the condition of *present*:

<figure><img src="https://675349995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUJNEE9TMK4fU91VKstBr%2Fuploads%2Fgit-blob-23ff5e58ac201a5f9907b0cb4a3ff018262a6d6e%2F10141050630289?alt=media" alt=""><figcaption></figcaption></figure>

If there is an output to your search, the step has been executed. On the other hand, if no invocations are listed, the step has not been executed.

&#x20;

**Example 5: Search to determine if an end-user dropped off from a chatbot Flow**

There is a variable in Flow Builder created upon every *Create Inbox Step* called `inboxTicket.ticketUrl` . It can be used to figure out how many Flows invocations ended by the end-user finishing the Flow successfully without human interaction in [Inbox](https://inbox.messagebird.com/), as opposed to those invocations that have ended with the end-user dropping off from the Flow.

By conjugating a search combining these two criteria:

* `inboxTicket.ticketUrl` **does not exist** (*an* [*Inbox*](https://inbox.messagebird.com/) *ticket was not created*) with
* an **Expired** logs status

you will be given a result indicating how many end-users have dropped out of the Flow.

If we conjugate these two criteria in the search:

* `inboxTicket.ticketUrl` **does not exist** (*an* [*Inbox*](https://inbox.messagebird.com/) *ticket was not created*) with
* a **Success** logs status

the result will show the number of invocations ending within the Flow, handled by the configured chatbot in a Flow, without resulting in an [Inbox](https://inbox.messagebird.com/) ticket.

For this search:

**1)** Visit the Flow

**2)** Navigate to its Logs:

<figure><img src="https://675349995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUJNEE9TMK4fU91VKstBr%2Fuploads%2Fgit-blob-815618ef7a4138f550a1e05d4eeca99098c03cba%2FLogs.jpg?alt=media" alt=""><figcaption></figcaption></figure>

**3)** Select the timeframe you would like to apply for your search:

<figure><img src="https://675349995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUJNEE9TMK4fU91VKstBr%2Fuploads%2Fgit-blob-823311c6bac99d5f7c87451cd0040f7340f3c70b%2FTimeframe.jpg?alt=media" alt=""><figcaption></figcaption></figure>

**4)** Add a filter of a *variable*, and use `inboxTicket.ticketUrl` is **not** **present**

**5)** Add a 3rd filter of *status*, set to **expired** or **success**, depending on if you are looking for the number of end-users that have dropped off (**expired**) or have been handled by the Flow's chatbot without ending in Inbox (**success**):

<figure><img src="https://675349995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUJNEE9TMK4fU91VKstBr%2Fuploads%2Fgit-blob-6cf9bb61aaa738861e0fa8f0abc1b18ae249043a%2F10637834920081?alt=media" alt=""><figcaption></figcaption></figure>

The output will be the number of such invocations.

FlowBuilder Logs can also be exported by following the instructions [here](https://docs.bird.com/connectivity-platform/troubleshoot-a-flow/export-flow-builder-logs).

📤  Feel free to [contact our Support](https://support.messagebird.com/hc/en-us/requests/new) in case you might need some help!
