Hello guys. I haven’t seen topic like this on the forum. If there is one I missed, please let me now. Otherwise, I’d be glad to open a discussion in this one.

Basically, I want to insert user input into SQL database with INSERT INTO query when user clicks on the button (btn_insert) in app. I think the main question is what to put in the output lines?

Tried following code with smaller variations, but nothing happens.

@app.callback([Output({"type": "insert-modal", "index": MATCH}, "is_open"),
Output({"type": "status-modal", "index": MATCH}, "is_open"),
Output({"type": "status-modal-message", "index": MATCH}, "children")],

Input({"type": "btn_insert", "index": MATCH}, "n_clicks"),

[State("dd_depart", "value"),
State("dd_week", "value"),
State("table_editable", "data"),
State("username-store", "data")])

def save(n_clicks, team, week, rows, username):
curr_time = pd.Timestamp("today")
tcomment = 'test'
insert_comment(tcomment, curr_time, conn = None)

In the app user already selected department and week from dropdown menus. Insert_comment is a function that includes SQL INSERT INTO code. As you can see right know there is ‘test’ assigned as a value for testing purposes while later it would have to read an user-input comment.