How to fetch data from doctype field to webform field

I just want fetch data from a doctype field to webform field…
Anyone please guide me what should we do for that…if you have any snippet sharr here please for better understanding…
@rahy Can you please help into this


That depends on how you create the webform.
What I do is to create webform based on an existing doctype. So the fields will be mapped between the webform and doctype.

Thank you for your response…

There is a field ‘designation’ in doctype ‘Job Opening’ and i want to fetch that designation from doctype and put into webForm ‘Submit your CV’ field automatically…
What should i do can you please tell me or any code you can share here for better understanding…

And also what to do if i want to mapped doctype to webform

How did you create your webform?
If you create it from the Website > Webform menu, it will automatically mapped when you select the referenced doctype.

You can use to trigger the method and use the frappe.get_doc to get the fields in the ‘Job Opening’ doctype, return it back to the js and output it the webform field.
I’m sorry, I’m not a programmer so I may not be able to give you the complete snippets.

Note: just a reminder… as this is an open forum, if not really necessary please don’t directly mention people here.
And it also close your opportunities to get help from other people as they might think you only need the person you mentioned.

1 Like