Workflow State and Document Status in list View

Hi @NCP,

I am trying to add the workflow state and document status in the list view of a document, as two separate columns. Currently there is no difference being seen in the list view.

Code:

frappe.listview_settings[“Employee Advance”] = {
add_fields: [“workflow_state”],
get_fields: function () {
return [“workflow_state”];
},
get_indicator(doc) {
console.log(“Employee Advance List View get_indicator called”);
if (doc.workflow_state) {
return [(“Workflow State”), “green”, “public,=,Yes”];
} else {
return [
(“Workflow State”), “darkgrey”, “public,=,No”];
}
},
onload: function (listview) {
const existing = frappe.route_options || {};
const filterKeys = Object.keys(existing);

	if (filterKeys.length === 0) {
		frappe.route_options = {
			_assign: ["like", frappe.session.user],
		};
	}
},
refresh: function (listview) {
	console.log("Employee Advance List View Refreshed");
	$("span.level-item.list-liked-by-me.hidden-xs").remove();
	$("span.list-row-like.hidden-xs").remove();
	$("span.comment-count.d-flex.align-items-center").remove();
	$("span.mx-2").remove();
},

How can I achieve this?

Thank you.