Frappe.db.get_value / set_value

Good Day

I manage to get single value with:

value = frappe.db.get_value(“User”,“first_name”,{“idx”: “2”})

but struggle to setvalue as i do not know what docname represent:

frappe.client.set_value(doctype, docname, fieldname, value)
frappe.client.set_value(“User”, docname, “first_name”, “Piet”)

This is just a test to understand api calls . . .

Thank You

Albertus Geyser

@Albertus
What I guess is your retrieving user with

so now you have specific user eg; in value variable you get Albertus user Now you want to set some specific value in Albertus user doc
doc = frappe.get_doc("User",<value>)

frappe.client.set_value(“User”, doc.name, “first_name”, “Piet”)

Hello Sir,
i am very new to erpnext can you help me with what should i write in <value>
Please help me i am stuck there from last 2, 3 hour and i am not getting any right resource.
doc = frappe.get_doc(“User”,<value>)

id of document which is “name” field of document

doc=frappe.get_doc(“Sales Invoice”,SINV-0001)