UI Action button development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2024 01:38 AM
I need to develop a UI action button in CSM workspace which will send reminder when pressed to last email sent to person. Need help in step by step in configuring action button in CSM workspace and the script which will extract the last email sent to person and then send reminder notification to the current case.
- 909 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2024 10:13 PM
Hi Charanjeet,
I used the above code in UI action script part, but I was not able to refer to the current case.And event was not also triggering
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2024 04:22 AM
When I am configured UI action button it is appearing in the case view but not in the workspace ,I have checked the workspace option instead
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2024 04:57 AM
Could you please upload the screenshot of the UI Action configurations.
For further requirements let me check.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2024 06:45 AM
Make sure to enable the other checkbox as well : "Format for Configurable Workspace". Please refer the screenshot
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2024 07:32 PM
UI action button in CSM Workspace that sends a reminder email for the last email sent to a person, you need to configure the following:
Step 1: Create the UI Action
Navigate to System UI > UI Actions in the ServiceNow instance.
Click New to create a new UI action.
Fill out the following fields:
- Name: Send Reminder
- Table: Case (or the table for CSM Workspace)
- Action name: send_reminder
- Show insert: True (if you want the button to be visible on new records).
- Show update: True (if you want the button visible on existing records).
- Condition: Write a condition that ensures the button only appears when appropriate. For example:current.state != 'Closed';
- Script: Leave blank for now; you will implement this in Step 4.
Save the UI action.
Step 2: Add the Button to CSM Workspace
- Navigate to Workspace Experience > Workspace Actions.
- Create a new action:
- Name: Send Reminder
- Table: Case (or the appropriate table).
- Action Type: UI Action
- Action Name: send_reminder.
- Add this action to the appropriate workspace view under Workspace Experience > View Configurations.
Step 3: Identify the Last Sent Email
The last email sent can be retrieved from the sys_email table. Use the following logic:
- Query the sys_email table to find the most recent email (type=send) linked to the case's associated person.
- Use the recipient email or user reference to filter the relevant email.
Step 4: Write the UI Action Script
Here is the script for the UI action to send the reminder:
Code sample
Step 5: Test the Button
- Open a case in the CSM Workspace.
- Ensure the contact has an email address.
- Click the Send Reminder button.
- Verify that:
- The last email is retrieved.
- A reminder notification is sent successfully.
- Relevant success or error messages are displayed.
Step 6: Optional - Add Notification Template
To standardise the reminder content, you can create a Notification:
- Navigate to System Notification > Email > Notifications.
- Create a notification template for the reminder email.
- Use the GlideRecord script above to trigger this notification.
This approach ensures modularity and better manageability for email content.