---
title: "Example 7b: Show a warning/error if a condition is not met (Advanced)"
canonical: "https://help.fieldbuddy.com/space/FBDOCS/5987926047/Example+7b%3A+Show+a+warning%2Ferror+if+a+condition+is+not+met+(Advanced)"
format: markdown
---
![Simulator Screenshot - iPhone 13 mini - 2025-01-10 at 12.00.36.png](media://50e08955-5ff5-4785-b98e-f90321d786c7)


### Configuration

- Add the following lines to `apps[number].screens[number].config.actionButtons[number]`

```json
{
  "condition": [
    {
      "executor": "jsonQuery",
      "type": "filter",
      "source": "${DATA}",
      "formula": "FIELDBUDDY__Work_Order__c[Id=${CURRENT_WORK_ORDER}&FIELDBUDDY__Closure_Status__c=FOLLOW_UP]:isNotEmpty"
    }
  ],
  "event": {
    "validation": [
      {
        "executor": "jsonQuery",
        "type": "validation",
        "alertType": "error",
        "source": "${DATA}",
        "alertMessage": "Please fill out the email if status is follow up",
        "alertDefaultText": "Please fill out the email if status is follow up",
        "formula": "FIELDBUDDY__Work_Order__c[Id=${CURRENT_WORK_ORDER}].Email_UN__c:isNotEmpty"
      }
    ],
    "dataBinding": [
      {
        "field": "Name",
        "table": "FIELDBUDDY__Work_Order__c",
        "var": "NAME"
      },
      {
        "field": "Id",
        "table": "FIELDBUDDY__Work_Order__c",
        "var": "ID"
      }
    ],
    "eventName": "onApply",
    "target": "WorkOrderSummary",
    "triggeredEvent": "navigate"
  },
  "config": {
    "confirm": true
  }
}
```

A working example can be found in line 4573 of [https://upperdeck.atlassian.net/wiki/spaces/FBDOCS/pages/5986680865](https://upperdeck.atlassian.net/wiki/spaces/FBDOCS/pages/5986680865)