List view json of Tasks in Activity Configuration (My Items widget)

Melinda Ivok
Tera Contributor

Hi,

We're trying to change how the list of cards look (which fields are included) for the Tasks in the My Items widget on Employee Center. In the Activity Configuration of Tasks there is a section called List view json, which seems to give advice on how to create such a template for this purpose. It's not clear though how to use it and where to insert it. We tried to add it to the List view script field above without any success. Does someone know how to do this?

 

Thanks in advance!

2 ACCEPTED SOLUTIONS

Hi @Melinda Ivok ,

Can you please add this API iActivityConfigurationUtil:

getMyTodos: function(limit) {
var listViewData = new sn_hr_sp.todoPageUtils().getMyOpenTodos(limit);
for (var listData = 0; listData < listViewData.length; listData++) {
listViewData[listData].field1Label = '';
listViewData[listData].field1Value = '';
listViewData[listData].field2Label = '';
listViewData[listData].field2Value = '';
}

return listViewData;
},
 
I am also attaching the screenshot for the same.

View solution in original post

You can use the fields 

getMyTodos: function(limit) {
var listViewData = new sn_hr_sp.todoPageUtils().getMyOpenTodos(limit);
for (var listData = 0; listData < listViewData.length; listData++) {
listViewData[listData].field1Label = '';
listViewData[listData].field1Value = '';
listViewData[listData].field2Label = '';
listViewData[listData].field2Value = '';
listViewData[listData].badge = '';
listViewData[listData].badgeColor = '';
}

 

View solution in original post

12 REPLIES 12

Ankit Kumar3
ServiceNow Employee
ServiceNow Employee

Hi @Melinda Ivok,

The list view of Tasks is derived from the "getMyTodos" API from the todoPageUtils script include. However, the fields from the card are derived from the To do configuration. In that configuration, we have a Title row and a detail row. If you will change those fields card would be updated with the selected fields.

Hi @Ankit Kumar3,
It is the fields in the My Items widgets that I would want to change, for example hide Price/Quantity (see attached picture). How and where can I do that?
Thank you in advance!
Best regards,

Melinda

Hi @Melinda Ivok , As I can understand you only need to hide the price and quantity for only Tasks.
To achieve this you can override the 'getMyTodos' API of ActivityConfigurationUtilSNC to the below code snippet:

getMyTodos: function(limit) {
var listViewData = new sn_hr_sp.todoPageUtils().getMyOpenTodos(limit);
listViewData.field1Label = '';
listViewData.field1Value = '';
listViewData.field2Label = '';
listViewData.field2Value = '';
return listViewData;
 

Unfortunately it didn't do anything. Do you have any other suggestion for how I can make this work?