How to Dynamically Show/Hide Fields and Fetch Data in Frappe UI?

Hi everyone,

I’m currently working on a project with Frappe UI and facing two issues:

  1. I want to dynamically show or hide fields based on the value of another field. In Frappe, this is straightforward in the Doctype setup, but I’m unsure how to achieve this functionality in Frappe UI.
  2. In standard Frappe, we can use the “fetch from” property to auto-populate fields based on the value of another field. However, I can’t figure out how to implement a similar feature in Frappe UI. For example, selecting an Employee Code should fetch the related employee details and populate other fields.

Could someone guide me on how to implement these features? Any advice or examples would be greatly appreciated!

Thank you in advance!