Default values for UI Builder pages

Community Alums
Not applicable

When it comes to using Required or Optional parameters for pages in UI Builder, is there a way to set a default value?

 

Use case:

1. My page requires a SysID

2. I either want to pass it an existing SysID or have it default to -1 (new record)

3. I need to be able to open this page using the side navigation menu (which does not allow parameter passing, so I need to be able to have a default value).

 

If I use recquired parameters and exclude -1 then I get page not found.

 

1 REPLY 1

JagjeetSingh
Kilo Sage
Kilo Sage

Hi,

 

Setting a default value for page parameters is not possible. Though you can pass in the values from side navigation menu. Below is an example. Let me know if you need help to create side navigation menu item.

 

{
      "label": {
        "translatable": true,
        "message": "Create Reord"
      },
      "routeInfo": {
        "route": "your_route",
        "fields": {             //This is how you can pass values for required parameters
          "sysId": "-1"
        }
      }
    }

 

 

 

Jagjeet Singh
ServiceNow Community Rising Star 2022/2023