We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

[UI Builder] Displaying the Activity Stream on Custom Tables

wemmersroy
Tera Contributor

Hi Fellow SerivceNow Developers! 

 

I've been struggeling the past time with trying to configure the Activity Stream and Activity Stream Compose components on a custom table; adding them as components in UI Builder, and for some reason could not get them to show, and when eventually I got them to show the fields would appear in the form, as well as in the Activity Stream Compose. 

Since I found a solution I thought I'd share it, as I could not find any comprehensive knowledge articles on this topic. 

 

Activity Stream and Compose

These components are filled by the Form Controller and can be filled using presets. For this example I've used the Record activity stream for activity stream combo preset. For the Activity Stream compose I've used the Record compose for activity stream combo preset. 

wemmersroy_7-1770814024406.pngwemmersroy_8-1770814033932.png

 

Both of these components are in completely stock configuration. 

 

Fields

You'll need two new fields on your custom table, both of type Journal Input. The fields are comments and work_notes(altough this one is optional). 

wemmersroy_0-1770813004499.png

 

Form

In the form of both the default view and the one you use in your Workspace you'll need to add the Formatter named Activities (Formatter) and you need to add the created fields to the form

From now on the Activity Stream should show up in your forms and also on custom Record Pages in UI Builder. 

wemmersroy_1-1770813278479.png

But right now (depending on your configuration) the fields Comments and Work Notes still appear in the form, and are therefore duplicate of the Activity Stream Compose. To prevent this we need to configure UX View Rule Configuration. 

wemmersroy_2-1770813327222.png

UX View Rules Configuration

With the View Rules we can define a rule to Hide Journal Input type fields. This rule is specifically designed for this activity, as regular UI Policies will hide the fields from the Compose as well. Navigate to UX View Rules Configuration and create a new config for your app.

wemmersroy_3-1770813611574.png

 

wemmersroy_4-1770813633908.png

 

Create a new Rule for your table and the appropriate view, deselect Experience Restricted and in Form Settings select Hide Journal Input Fields. 

wemmersroy_5-1770813906879.png

 

Congrats!

You've added the activity stream to your custom table and successfully hid the journal input fields on the form using the Next Experience settings. 

wemmersroy_6-1770813933920.png

 

Cheers! 

0 REPLIES 0