I have a refresh button that will get the latest data from database everytime i pressed. I can see the new data from terminal but the data couldn't show in the drop down list.
For example: New data "newaddded" can be shown in terminal every time i pressed "refresh" :
BUT the "newadded" data cannot be shown in tkinter drop down list :

My code:
def MainMenuForm():
refresh_button = Button(root, text="refresh", command=ListboxContent)
refresh_button.place(x=130, y=17, width=50, height=22)
JsonPresetLBL = Label(jsonframe, text="JSON Preset:", font=("Calibri", 11, "bold"), fg="black")
JsonPresetLBL.place(x=200, y=170)
global options
options = StringVar(jsonframe)
options.set("Select ") # default value
om1 = OptionMenu(jsonframe, options, *jsonprofileName, command=get)
om1.place(x=290, y=168, width=100)
def ListboxContent():
# ==========jsonProfileName================
cur = con.cursor()
sqlName = ("select jsonid, jsonprofilename from json")
# call jsonProfileName
global jsonprofileName
jsonprofileName = []
try:
cur.execute(sqlName)
results = cur.fetchall()
for a in results:
global data
data = (a[1])
jsonprofileName.append(data)
print(data)
except:
print("Error: unable to fetch data")
