ERPNext.com Frappe Cloud Support Partners Foundation Frappe School

Displaying Array data in select field

Hi All,

I am trying to create a script report with filters and try to give a dropdown to select item name in the filter.
I have array of item name but i am not able to displaying item name in the select field.
Please suggest

Here is my JS File

let itemName=[]

frappe.query_reports[“demo_script_report”] = {

onload: function(report){
	frappe.call({
		method:"url.get_itemNames",
		callback:function(r){
				
			console.log(r)
			r.message.forEach((item,i) => {
				itemName.push(item[0])
			});

			console.log(itemName) // It has all the item names when page loads
		}
		
	})
	
},
"filters":[
	{
		"fieldname":"item_name",
		"label":__("Item Name"),
		"fieldtype":"Select",
		"options":itemName, //here its not loading the data
		"width":250,
		"reqd":0,
	}
	]
}

Filter