Populate Categories Dynamically

ujjwala_678
Tera Contributor

Hello Everyone,

I have been trying to set categories on asmt_metric_type table for a particular metric type...At present all categories are getting appearing but the requirement says that categories should auto-populate based on the categories selected by user on the assessments table..for this, I have created a custom field of type 'list' so that user can select categories whichever applicable to him, I am trying to achieve this using BR, but i don't think it is going to work...could anyone please suggest me any better approach here?

I am using below code in After/insert BR on assessment table-

var selectedCategories = current.categories.sys_id;
var categories = [];
var category = new GlideRecord("asmt_metric_category");
category.addQuery('metric_type', 'test assessment');
category.query();
while (category.next()) {
categories.push(selectedCategories.sys_id.toString());
}

return categories.toString();
 
Any sort of help here is highly appreciated!
Thank you
0 REPLIES 0