How do I use OnSelect in Power Apps?
While holding down the Alt key, click or tap the background of the gallery or any control in the gallery. All actions will show the Gallery Selected notification at the top of the app. Use the gallery's OnSelect property to specify the default action to take when the user clicks or taps an item in the gallery.
How do I set field value in Power Apps?
Preview the Powerapps app:
Then Preview (F5) the app and choose the Department value as VISITORS. Enter the Visitor's Name and other fields, then submit the form. Similarly, choose the Department value as IT, HR, or FINANCE. Enter the Employee Name and other fields, then submit the form.