adding more fields to the cart

Nora3
Kilo Expert

Hi,

We have added multiple fields to the shopping cart in the service portal through the "sc shopping cart" widget. The issue we have is that the content of the fields are not added until after our workflow has run.

For example we have a field called cost center, this field is a reference field that we have added on the cart widget. We want this to be inserted on the sc_request when the user checkout and before our workflow on request table runs.  We have solved this temporarily by adding the cost center sys_id to the special instructions field, so we can fetch the sys_id and use it in our workflow. This is not a permanent solution because if the special instructions needs input from the user this fails. We are looking for a solution that helps us add extra fields to our cart and adds the value in the request table before the workflows runs.

Please please help!!!!

Thanks.

1 ACCEPTED SOLUTION

Nora3
Kilo Expert

Hi!

I contacted HI and their solution to this was:

 

"As a suggestion for this, you might want to add a custom field on sc_cart table and fill the data into the field of the record when the request is submitted.

Once this custom field on sc_cart have the value in it, it can be used in the Workflow by querying on sc_cart table and using it afterwards wherever required."

 

So basically we created our fields that show in the shopping cart in the "sc shopping cart" widget. Then we also created the same fields on the sc_cart and sc_request table. After this we copy the values from the shopping cart fields to the sc_cart fields. The last thing we do is that our first step in the requested item workflow queries the users default sc_cart and sets the requests fields to the same values.

 

This solved our problem.

View solution in original post

3 REPLIES 3

Alberto Consonn
ServiceNow Employee
ServiceNow Employee

Hi,

I would recommend you to use the solution provided by William Busby in the below thread:

https://community.servicenow.com/community?id=community_question&sys_id=777ab271dbc613c0c310fb651f96...

If I have answered your question, please mark my response as correct and/or helpful so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.

Thank you

Cheers
Alberto

Pratiksha Kalam
Kilo Sage

Hi ,

Refer below link will help you,

you must add whatever fields you are wanting to both the sc_request and the sc_cart tables. Then I just used this article for the cartpop since I was adding more than one new field.

 

If my reply helps you at all, I’d really appreciate it if you click the Helpful button and if my reply is the answer you were looking for, it would be awesome if you could click both the Helpful and Accepted Solution buttons! 🙂


Regards,
Pratiksha

 

Nora3
Kilo Expert

Hi!

I contacted HI and their solution to this was:

 

"As a suggestion for this, you might want to add a custom field on sc_cart table and fill the data into the field of the record when the request is submitted.

Once this custom field on sc_cart have the value in it, it can be used in the Workflow by querying on sc_cart table and using it afterwards wherever required."

 

So basically we created our fields that show in the shopping cart in the "sc shopping cart" widget. Then we also created the same fields on the sc_cart and sc_request table. After this we copy the values from the shopping cart fields to the sc_cart fields. The last thing we do is that our first step in the requested item workflow queries the users default sc_cart and sets the requests fields to the same values.

 

This solved our problem.