Set recurring price of choice list in onChange client script

Hannah C
Giga Expert

Hello,

I have a select box variable called data_amount

There are options 1, 10, 100, and other.

When other is selected, a text box called other_amount appears where the user can enter a number. When they enter the number here, I want to update the recurring price field on the choice other. Does anyone know how to do that?

11 REPLIES 11

Mark Roethof
Tera Patron
Tera Patron

Slightly updated + tested in my personal developer instance. Instantly works!

find_real_file.png

find_real_file.png

If my answer helped you in any way, please then mark it as helpful.

Kind records,
Mark

---

LinkedIn

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Thanks Mark! But won't that be changing the price on the request after the request is submitted? I want to change the price on the question_choice table so that it updates the cart in the portal before the request is submitted.

Well you could of course update the choice, but that would impact all future request if the recurring price is applicable by default and you not updating thru other_amount selection.

Also updating the choice value could have a collision if somehow two requests are entered on almost the same time. User A has other_amount 560, User B enters 5 seconds later other_amount 15000, then User A submits... 

Kind regards,
Mark

---

LinkedIn

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Hi there,

Is your question solved with this? Do we need to follow-up on this?

Please mark this answer as correct if it solves your problem. This will help others who are looking for a similar solution. Also marking this answer as correct takes the post of the unsolved list.
Thanks.

Kind regards,
Mark

---

LinkedIn

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

I am not sure what to do because the example you provided creates a new recurring price record and is after the request is created. I am trying to update the price shown in the cart before a request is submitted/created. So I want to update the recurring price field that already exists...