- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2023 10:30 PM
Hi everyone,
I have a problem, when selecting data for Car Name, if I select Other, there will be a Car Name 2 field that will be opened below. After data entry and Submit, I want the data entered in Car Name 2 to be added to Car Name's Choice list.
Does anyone have any solutions?
Thanks,
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2023 12:13 AM
Hi @Chronos you can write After insert Business rule using below code
if(current.u_car_name2!='')
var gr = new GlideRecord('sys_choice');
gr.initialize();
gr.name ='YOUR TABLE NAME';
gr.element= u_car_name;
gr.label=current.u_car_name2;
gr.value=current.u_car_name2;
gr.insert();
You can also achieve this using Flow Designer and that would be recommended as it is low code.
If my answer solved your issue, please mark my answer as ✅Correct & 👍Helpful
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2023 10:40 PM
Have you tried creating a Flow (using Flow Designer), triggered to run on insert of whatever is involved, if the field has value Other?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2023 10:49 PM
I think this can be done by writing Business Rule on Insert, but I have no idea how to do that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2023 12:13 AM
Hi @Chronos you can write After insert Business rule using below code
if(current.u_car_name2!='')
var gr = new GlideRecord('sys_choice');
gr.initialize();
gr.name ='YOUR TABLE NAME';
gr.element= u_car_name;
gr.label=current.u_car_name2;
gr.value=current.u_car_name2;
gr.insert();
You can also achieve this using Flow Designer and that would be recommended as it is low code.
If my answer solved your issue, please mark my answer as ✅Correct & 👍Helpful
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2023 09:00 PM
Hi, @priyasunku
Thanks for guiding me in the right way, but I should fix it a bit in your code
if(current.u_car_name2!='')
var gr = new GlideRecord('sys_choice');
gr.initialize();
gr.name ='YOUR TABLE NAME';
gr.element= 'u_car_name';
gr.label=current.u_car_name2;
gr.value=current.u_car_name2;
gr.insert();