Service Portal "Cart" Page

arnabbose
Tera Expert

Hello,

In the Checking - Out Shopping Cart of SERVICE PORTAL , only the User's Name comes by default in Requested For field , so it's confusing if we have 2 - 3 users of same name. Also, we cannot browse like in standard service catalog to check user's   details or hover on i icon to know the same in SERVICE PORTAL.

Is there ANY way in which we can add User ID / User Email there for proper identification ?

1 ACCEPTED SOLUTION

krr
Mega Guru

We had the same scenario and to fix this you need to do this



Note: the OOTB widget has a bug unfortunately that doesn't allow you to simply create a new template, I tried. I'll put in a ticket for this since it probably effects more people. The overall issue is that the widget expects the option carttemplate but the widget option is cartTemplate. This appears to be case sensitive, so you can't just create a new template and i don't want to edit the OOTB widgets in case we need to revert some time.



Clone the widget and fix a bug


  • Clone the SC Shopping Cart widget to My SC Shopping Cart
  • Click the hamburger menu (the 3 horizontal lines in the top right)
  • Click Edit option schema
  • Change Name
    • From: cartTemplate
    • To: carttemplate


Copy the template


  • Go to the Widget list in the platform (not the widget editor)
  • Open the SC Shopping Cart widget (not the cloned one)
  • Scroll to the bottom to the Angular ng-templates tab
  • Open large_shopping_cart.html
  • Change these properties
    • ID: my_large_shopping_cart.html
    • Widget: My SC Shopping Cart
  • Right click the header and choose Insert and Stay to copy this to your cloned widget.


Update the template



Inside the Template code of your now copied template, scroll down until you find this code



<label>${Requested For}</label>


<sn-record-picker field="c.requestedFor" table="'sys_user'" display-field="'name'" value-field="'sys_id'" search-fields="'name'" page-size="100" ></sn-record-picker>



Change the sn-record-picker to this to show the name and their user name.



<sn-record-picker field="c.requestedFor" table="'sys_user'" display-field="'name'" display-fields="'user_name'" value-field="'sys_id'" search-fields="'name,user_name'" page-size="100" ></sn-record-picker>



In particular you can play with display-fields, this will show the values below the name in the list as you type. You can try to mess with the values, it will hold more than one options If I recall.



Update the cart page


  • Open the Page designer
  • Choose the Shopping Cart [sc_cart] page
  • Delete the SC Shopping Cart widget
  • Add your newly created My SC Shopping Cart widget
  • Click the Pencil icon to edit the options
  • Under Cart Template, enter my_large_shopping_cart.html


This will use your new shopping cart template


View solution in original post

15 REPLIES 15

HugoFirst
Kilo Sage

Hello Arnab,



My answer is probably not what you're looking for, but I'm sending it to you in the event that you have both the freedom to make the change I suggest and that it helps your organization resolve this kind of ambiguity.



We had 2 people with the same exact name and what we did was include a short, 2 word job description in parens in their last name.


For example



John Doe(DB2 Support)


John Doe(Networking)



This seems to be more helpful than going to middle initials or including employee id's with the pick list.


Hi Steve,



We cannot change user names like that. It's an user base of 20K+ and its populated by LDAP integration from Active Directory.


Understood.


In our case, their names were changed in the LDAP, when then fed into ServiceNow via our import.


In fact, the names were setup this way to help people select the correct name when sending email. ServiceNow was not even a factor in the decision. But it was a beneficiary when our users had to select names for requests, assignments, etc.


ben_hollifield
Tera Guru

Hi Arnab,



Also not the immediate fix that you may prefer, but we've noticed this issue throughout Catalog in Service Portal, both in item variables and the checkout screen. We've included updated widgets in the Yansa Design System to address this, allowing specification of additional fields for reference pickers. Let me know if this is something you'd like to learn more about.



http://www.yansa.io/yds/#catalog_item_widget_yds