Posts

PowerApps - Filter Combo box control based on another table

Image
Overview: I have two tables TableA (Columns: ProjectId, ProjectName, Project (GUID)) TableB (Columns: ResourceName, TableA.Project) TableA has one-many relationship with TableB or TableB has many-one relationship with TableA. Below are some sample data: Use case: In "Start screen", I have combo box control and I need to display all the Projects where the current logged in user is part of  it.  The combo box control should display Project Id and ProjectName columns. To do that,  Set Layout as Double Set the Primary text to ProjectId column Set the Secondary text to ProjectName column If you have set IsSearchable to true then select the SearchField based on your need. Here I'm going to search based on ProjectId column Write the below code in OnVisible property of "Start screen": Write the below code in Items property of Combo box control:     Result: Consider the same data,  If the current logged user is "John" then Combo box control will list the ...

PowerApps - Existing Date picker component - Current month date is not selectable

Image
 Issue faced in the existing app - "Date Picker v3.msapp" downloaded from other source: I've a screen where the date picker is displayed and lets assume that the current month is May. After opening the screen, I'm trying to pick a date, lets say May 3rd. When I click on 3rd, the date is not selected.  But,  I navigate to Previous month (by clicking < icon) and selected some date in that previous month and come back to current month then selected the date, now the 3rd May is selected. Or I navigate to Next month (by clicking > icon) and selected some date in that next month and come back to current month then selected the date, now the 3rd May is selected.  Date picker - UI Code before fix:  Code written in  OnSelect property - when the Date is selected from the date picker, this code will be executed.  The issue: "_firstDayInView" variable is not set initially. Title_MonthDay_1 control - OnSelect Code after fix:         ...

PowerApps - Work around for "OnChange event is triggered automatically when navigate to different records in Gallery"

Image
Issue faced in Form - Edit mode:     My screen: I've Edit Form in "My screen", there are 3 controls. When changing the 1st control's (combo box) value, the OnChange event will be triggered where I've written the code to clear the other 2 control's value. Note : Other controls data should be cleared only when 1st control's value is changed manually by the user.     Code written in OnChange property of 1st control:      Code written in Default property of other 2 controls:     Code written in OnVisible property of "My screen":     Scenario:  From gallery screen, I've opened the record (let say R2), the OnChange event in 1st control is not triggered, so other controls data is not cleared as expected.  When trying to open the different record (lets say R4) for the second time, the OnChange event in 1st control is triggered and so other controls data is cleared. But in this scenario, the OnChange event code must not be executed...