---
sourceDocument: Yokohama Mobile Configuration and Navigation
sourceDocumentLink: https://www.servicenow.com/docs/r/yokohama/mobile

 Release :

    - yokohama

ft:locale :

    - en-US

ft:publication_title :

    - Yokohama Mobile Configuration and Navigation

ft:clusterId :

    - mobile

bundleId :

    - mobile

workflow :

    - evelopment, Data and Analytics


---

# Create a mobile UI rule action

# Create a mobile UI rule action {#ariaid-title1}

* Release version: Yokohama
* 
* Updated January 30, 2025
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 5 minutes to read

Create the actions that execute when your mobile UI rule conditions are
met.

## Before you begin

Role required: admin

## Procedure

1. Navigate to AllSystem MobileMobile UIMobile UI Rules.
2. Open the mobile UI rule where you want to add actions.
3. In the mobile UI rule form, select New in the Mobile UI rule actions related list.  
   Note:  
   If you don't see the New button, you may be in a difference scope than the UI Rule. Change scopes and reload the form to display the button.
4. In the mobile UI rule action form, fill in the fields.  
   {#create-mobile-ui-rule-action__table_xqw_clq_lnb__entry__2}

   | Field | Value |
   |-|-|
   | UI Rule | The UI rule related to this action. This field automatically populates with the rule that you opened in step 2. |
   | Operation | Select the operation that the action performs See the following table for details on these actions. |
   | Target | The element affected by the action. The actions available to select depend on the parent selected in your mobile UI rule. * For input form screens, the targets are input form screen inputs * For mobile views, targets are elements from the mobile card template JSON. {#create-mobile-ui-rule-action__ul_pz1_fzq_lnb} |
   | Order | Order in which the action executes. If there are multiple actions for the same mobile UI rule, the actions execute according to this value. Lower numbered rules execute before higher numbered rules |
   | Value | Defines how the action applies to the element in the Target field. This value depends on the selected Operation. See the following table for operation descriptions and the values that they use. |
   | Target Mapping | Defines which string input field the generated summary text should be added to when using the Record Summarization operation. |
   [Table 1. Mobile UI rule action fields]

   {#create-mobile-ui-rule-action__table_xqw_clq_lnb}  
   {#create-mobile-ui-rule-action__table_adx_dmq_lnb__entry__3}

   | Operation | Definition | Values |
   |-|-|-|
   | Disable Button | Determines whether the button in the Target field is inactive. | Set the Value to <kbd class="ph userinput">true</kbd> to disable a button or <kbd class="ph userinput">false</kbd> to enable it. |
   | Set Mandatory | Determines if the element in the Target field is required. | Set the Value to <kbd class="ph userinput">true</kbd> to make the element mandatory or <kbd class="ph userinput">false</kbd> to make it optional. |
   | Set Read-only | Determines whether the element in the Target field is read-only. | Set the Value to <kbd class="ph userinput">true</kbd> to make an element read-only, or <kbd class="ph userinput">false</kbd> make the element editable. |
   | Set UI Style | Applies UI styling to an element. Note: This operation doesn't reverse when using Reverse If False on your mobile UI rule. | Use this value to set a background color, font color, and text decorator icon. The value must be in JSON format. This example changes the colors of the background and text: { "BackgroundColor": "#E1E1E1", "BackgroundColorVariable": "--now-color-secondary-3" } This example sets a text decorator icon. { "TextDecorator":{ "Type": "Font", "FontName": "now-mobile-icons-cards", "Value": "IconCode", "FontColor": "#1E4335" } } You can also use color variables to change theming in your mobile UI rules. For details see [Color variable support for UI rules](https://www.servicenow.com/docs/3zBLHFqzg7b77tm_zcdVmg "Learn how to use color variables to change theming in your mobile UI rules."). Note: * <kbd class="ph userinput">IconCode</kbd> must be replaced with a valid icon code. For a list of icon codes, see [Mobile icons](https://www.servicenow.com/docs/6ezZ60kUeRntKd3Rwl5zog "Use icons to provide unique identifiers for navigation and actions in your mobile applications.") * Use a JSON validator when copying and pasting JSON code from a topic, to make sure all code is correctly applied. |
   | Set Visibility | Determines the visibility of the element in the Target field is read-only. | Set the Value to <kbd class="ph userinput">true</kbd> to display the element, or <kbd class="ph userinput">false</kbd> to hide the element. |
   | Simple Arithmetic | Note: This operation doesn't reverse when using Reverse If False on your mobile UI rule. | Set the Value by creating a mathematical operation using inputs from the input form screen associate with your mobile UI rule. For example, if you wanted to calculate travel costs you could use: cost_per_mile*miles_traveled In this example, the values in the `cost_per_mile` and `miles_traveled` inputs would be multiplied. For this operation to work, the input form screen would need inputs matching these names. |
   | Time ago | Applies a time indicator to a record, for example "Updated 3 minutes ago" or "Created 2 months ago". Note: This operation doesn't reverse when using Reverse If False on your mobile UI rule. | The following fields must be set: * In the Operation field, enter <kbd class="ph userinput">Date Formatter</kbd>. * In the Target field, set the target to a mobile view element that uses a DateTime input. * In the Value field, enter <kbd class="ph userinput">timeago</kbd>. {#create-mobile-ui-rule-action__ul_flc_pz3_2qb} Use any of the following option parameters for `timeago`: `timeago(negative text value, positive text value, verbose flag);` negative text value :   The value displayed for past dates, using `%d` in place of the numerical value. positive text value :   The value displayed for future dates, using `%d` in place of the numerical value. verbose flag :   Whether a short or long version of the time format is displayed. This field value is `true` or `false`. For example, when set to true, '2 minutes ago' is displayed. If set to false, '2 m ago' is displayed. In this example, you see values such as "Expired 5 hours ago" or "Expires in 5 days" depending on the time value. timeago("Expired %d ago", "Expires in %d", true)​; |
   | Time and date calculation | Automatically calculates an end time after entering a start time. The end time value can be in the past or the future. For example, you select a meeting to start at 15:00, the default calculation is set to 30 minutes later, so 15:30 displays as the default end time. Note: This operation doesn't reverse when using Reverse If False on your mobile UI rule. | The following fields must be set: * In the Operation field, enter <kbd class="ph userinput">Date Calculation</kbd>. * In the Target field, set the target to an input form screen element that uses a DateTime input. * In the Value field, enter the input structure using the following syntax \<input name\> +/- \<duration\>. The duration value is formatted in the following way: * `10d` = 10 days * `5h` = 5 hours * `3m` = 3 minutes * `2s` = 12 seconds {#create-mobile-ui-rule-action__ul_iss_cfj_2qb} For example, an entry of `start_time + 1d8h `sets the value to be calculated at 1 day and 8 hours after the start time. {#create-mobile-ui-rule-action__ul_dhq_nbj_2qb} Note: You can't use month and year in the time and date calculation. |
   | Record Summarization | Enables record summarization using Now Assist. Note: This operation requires Now Assist to be configured. For more information, see [AI Admin Hub console](https://www.servicenow.com/docs/access?context=configuring-now-assist&version=yokohama&pubname=yokohama-intelligent-experiences&ft:locale=en-US). | In the Target Mapping field, enter the string input field that the generated text should be added to. |
   [Table 2. Mobile UI rule action operations]

   {#create-mobile-ui-rule-action__table_adx_dmq_lnb}

*[\>]: and then


