Why is the value not reflected in my list view for my referenced field?

Ronald11
Tera Expert

Hello,

I was testing if I could put a custom column in sys_approval table to put for information for my knowledge article that is approve.

So I created a new dictionary record on sys_approval table as reference type referencing knowledge.

find_real_file.png

But did I miss something? since when I configured my list, the value for short description is not reflected on the list view even though it is existing on the KB article?

find_real_file.png

find_real_file.png

Thanks in advance

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

so even when value is selected it's not showing the display value on list?

how it behaves on form?

regards
Ankur

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

Hello, 

Yes the field for short description and workflow is selected to show on my list, but those columns are not showing the value.

find_real_file.png

Value not displayed on short description and workflow column.

find_real_file.png

But it could be seen that in the approval record referencing knowledge article there is value for short description and workflow column.

find_real_file.png

This is how i configured my referenced field on sys_approval table.

find_real_file.png

Thanks in advance

Hello,

That will not work like this, See what we have done

1) Create custom field on approval record 'KB Short description'.

2) In Dictionary of custom field we have added script like below in 'Calculated value' section.

find_real_file.png

Script :

(function calculatedFieldValue(current) {

	// Add your code here
	if (current.source_table == "kb_knowledge"){
		var gr = new GlideRecord(current.source_table);
		var sd = "";
		gr.addQuery('sys_id',current.document_id);
		gr.query();

		while(gr.next()){
			
				sd = gr.short_description;		
		}
		return sd;  // return the calculated value
	}
	return '';

})(current);

This way it will work properly, Apply same logic in your case.

Please hit like and mark my response as correct if that helps

Regards

Please hit like and mark my response as correct if that helps
Regards,
Musab

Hello, 

thanks for the workaround, but I think it still doens't solve the problem, since the field would be created individually. I think it would be more ideal if were able to leverage using reference. As I looked on the other field on sys_approval table, it was also using some referenced table as field. I just can't find what am I missing to make this work.

Thanks.