ERPNext.com Frappe Cloud Support Partners Foundation Frappe School

Frappe.db.get_list synchronously

Hey,

I’m trying to run frappe.db.get_list synchronously, so that I’ll have something like:

var items;
frappe.db.get_list('Test Doctype',{
	'filters':{
		'_user_tags':['like', '%' + tag_name + '%']
	},
	'pluck':'name'
	},
	'async': false // Is there anything similar that **would** work?
	).then(r => {
		items = r
	});
	alert(items); // This gives back: "Uncaught (in promise) TypeError: items is undefined"
	});

and actually see the list of items.

Anyone?
Pleeeeeeeas help!!
:pleading_face:

frappe.run_serially?

what are you trying to achieve exactly ?