Custom Field Mapping to Catalog Item variable

SantushtS
Tera Contributor

Hi,

How i can map the custom choice type field(Educational unit Impacted) that is created on RITM table to catalog item variable(Educational Unit Impacted), so that after submitting the form from portal the value should be reflected in RITM custom choice field as well which coming under variables as APEI but not on  RITM custom field.

 

 

SantushtS_0-1741713098172.png

 

9 REPLIES 9

Hi @SantushtS ,

 

In that case you can utilize sc_item_option table. In this table record of variables gets created with it's value.

  1. Create a flow with trigger point Requested Item Created
  2. Look up record on sc_item_option table.
  3. Question contains Educational Unit Impacted. Don't use Question is Education Unit Impacted (Because every time a SC Catalog triggers with Educational Unit Impacted variable it will create a record with that value in Question).
  4. Now you have to opt that value of Education Unit Impacted which is recently created every time. Hence Order by Created and in Descending Order.
  5. Now update your RITM record in next action and update your RITM field with the sc_item_option Question Value.
  6. This will work for all Catalog Items. Here in example I have taken sc_task
  7. Also make sure that you are not creating any other variable which conatins "Education Unit Impacted" in name other wise system will not able to recognize which question needs to be picked for assigning value.

RohitSingh_1-1741720080631.png

RohitSingh_2-1741720188774.png

 

If my response helped, please hit the Thumb Icon and accept the solution so that it benefits future readers.

 

Regards,
Rohit

Hi Rohit ,

 

Thanks for your information just one more can i do it for RITM and catalog task both for all catalog item .

 

Thanks,

Santusht

Yes, you can. 

Please mark my response as helpful and also accept my solution.

 

regards,

Rohit

Helllo @SantushtS 

 

Yes, you can. 

Please mark my response as helpful and also accept my solution.

 

Regards,

Rohit

Ankur Bawiskar
Tera Patron
Tera Patron

@SantushtS 

Why not use after insert business rule on sc_req_item table and handle this and it will work for all RITMs whose catalog item has that variable?

Ensure choice values are same between the variable and field on RITM

(function executeRule(current, previous /*null when async*/) {

	// Add your code here
	current.fieldName = current.variables.variableName;
	current.setWorkflow(false);
	current.update();

})(current, previous);

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader