How do I update a record of a table with the value added through the input in UI Builder?

Community Alums
Not applicable

Hello! I am using UI Builder in San Diego version, and I use two components, an Input and a Button. The idea is to take the value that is entered through the Input and update the "value" field of the sys_properties table with the same value that was entered in the Input. I understand that I should use an Script Include, but do you have any idea how to do it, and what Apis should I use for this? Thank you.

1 ACCEPTED SOLUTION

Marc Mouries
ServiceNow Employee
ServiceNow Employee

First, you need to retrieve the value of the field. In your scenario, it is a system property. 

In my example, I will create a system property "uib_example.date_format" in my application "UIB Examples"

  1. Navigate to System Properties > UI Properties (sys_properties.list)
  2. Then create a new property and set the following values
    1. name = "date.format"
    2. scope= your application
    3. type = string
    4. value = dd-mm-yyyy
    5. Add the role snc_internal to both read and write
  3. (If you're trying to change a Global system property it will require a separate discussion)

The answer started to get quite long so I created an article

 

How to read and update a record with the value from a field in UI Builder?

View solution in original post

1 REPLY 1

Marc Mouries
ServiceNow Employee
ServiceNow Employee

First, you need to retrieve the value of the field. In your scenario, it is a system property. 

In my example, I will create a system property "uib_example.date_format" in my application "UIB Examples"

  1. Navigate to System Properties > UI Properties (sys_properties.list)
  2. Then create a new property and set the following values
    1. name = "date.format"
    2. scope= your application
    3. type = string
    4. value = dd-mm-yyyy
    5. Add the role snc_internal to both read and write
  3. (If you're trying to change a Global system property it will require a separate discussion)

The answer started to get quite long so I created an article

 

How to read and update a record with the value from a field in UI Builder?