Skip to content
Developerhome

Status Message property

  Less than to read

The “status_message” property in the JSON Schema allows you to display different status messages in your web screens. This guide will explain how to use the “status_message” property effectively to provide feedback to users.

Understanding the “status_message” Property

The “status_message” property is used to display messages based on different status conditions. It allows you to provide information, success messages, or error messages to users based on specific actions or events in your web screen.

To use the “status_message” property, you define different messages for various status conditions. For example, you can set a success message when an action is completed successfully or an error message when an error occurs during an operation. These messages can be displayed to users to provide feedback on their actions or to convey important information.

Example Schema

To illustrate the usage of the “status_message” property, consider the following example schema where different actions trigger the display of success and error messages:

In the below schema, the “success” action sets the “status_message” property to display a success message with the value “Message”. Similarly, the “error” action sets the “status_message” property to display an error message with the value “Message”.

{
  "version": "1.0",
  "pages": ["sop/new-sales-order"],
  "actions": {
    "success": [
      {
        "set": {
          "status_message": {
            "success": {
              "string": {
                "value": "Message"
              }
            }
          }
        }
      }
    ],
    "error": [
      {
        "set": {
          "status_message": {
            "error": {
              "string": {
                "value": "Message"
              }
            }
          }
        }
      }
    ]
  },
  "validations": {},
  "events": []
}

The “status_message” property is a useful tool for providing feedback and conveying important information to users in your web screens. By Utilising this property effectively, you can enhance the user experience by displaying relevant messages based on specific actions or events.