In my case, I need to add custom filtering when I select a lookup it will populate another lookup. when the user will click on the search icon it will show only filter data. I was following: https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/controls/addpresearch sample code: var demoLAB = demoLAB || {}; var classId; demoLAB.Stuedent = { Form: { Load: function (executionContext) { 'use strict'; var formContext = executionContext.getFormContext(); this.attachEvents(executionContext); }, attachEvents: function (executionContext) { 'use strict'; var formContext = executionContext.getFormContext(); var form = demoLAB.Stuedent.Form; // Student Change Event formContext.getAttribute("demo_studentId").addOnChange(form.studentOnChange); }, studentOnChange: function (executionContext) { ...
Work smarter, not harder.