Posts

Creating Nested Galleries in Power Apps. (Parent-Child Relationship)

Image
 This is another most common scenario where in client has two parent child lists or any two lists having a common SharePoint column. And clients wishes to have a relationship on the PowerApps screen where in when he/she selects a particular lets say Program in our example. All the respective Projects following that Projects are shown. In such a scenario we can leverage nested galleries. So what we do in here is we add two galleries on our Power App screen. For Programs gallery the Left one on the screenshot above, we connect it to the Programs list For Second gallery we will connect it to the Projects list. But this is where the magic happens. Here we use Filter () function. So what we do in here is we set the Program's column value in Project's list equal to the Selected Program of left Gallery. i.e. the gallery connected to my Program's list. A more complex version of the same is where you inset the nested gallery inside your parent gallery. In this too everything remains...

Reset () function failing to work on Edit form for Combo boxes in Power App.

Image
 Hi Good day, Today we have a very interesting scenario. We have a cascading dropdowns on our Power App screen. The flow for these dropdowns is that a user selects the Division, and a list of Business units containing the selected Division is popped down in your Business Unit dropdown. Now to make it user friendly, we have on change code written on each dropdown. So that if the user decides to change the Division dropdown, the Business Unit dropdown is reset. Please remember in here we are talking in regarding to New Form. On Resetting the above Division combo box, since we have written the Reset function code on Change property of the Division Combo box.   Reset(ddBU);Reset(ddBPI);Reset(ddTeams). The above becomes Up till here everything is hunky dory. This is the classic case of how the Reset() function should behave. But that's not, when you move from new form to Edit form.   The Reset function behaves weirdly. It is able to reset the cascading dropdown values li...

The Switch Control issue : Power Automate

Image
 Today I ran into a unique scenario. I had to trigger emails on dropdown change of a field in my Power App.  Power Automate was the obvious choice but since i had 4-5 options in choice field i decided to use Switch control rather than the condition control. Switch control is an interesting control, it not only makes your flow short, but also more efficient. But there is a bug in the Power automate Switch control. Lets get into it. All you need to do is replace your column Name choice with the below Coalesce Function. coalesce(triggerBody()?['Stage']?['Value'],'Unknown') This will help you remove the bug in Switch control which otherwise will throw an exception like below. The execution of template action ‘Switch’ failed: The result of the evaluation of ‘scope’ action expression ‘@triggerBody()?[‘Choice’]?[‘Value’]’ is not valid. It is of type ‘Null’ but is expected to be a value of type ‘String, Integer’

Implementing Radio buttons choice fields in Power Apps.

Image
 Another quick tip. By default even if you have created a radio button type choice column in SharePoint the mighty Power App will show it as Combobox. But there is a quick fix to this. Follow the below steps and have fun. 1. Select the combo box in the Data Card. You may have to unlock the card if it's not unlocked already. 2. Navigate to the item Property of the Combo box and copy it. 3. Delete the Combo box & insert a Radio control in the card. 4. Paste the copied item property of Combo box in Item property of Radio control 5. Set the update property of Data card as Radio1.Selected.     

Implementing "|| & ," in Filtering in Power Apps

Image
  Another filtering nuance i ran into today was how to implement Logical filters in Power Apps. You will find different blog posts and videos on how to implement multiple filter in Power Apps, but there isn't much showing how to implement logical filters in PowerApps.  From outset this is quiet a simple case.  Scenario: i have 3 people picker controls in my SharePoint list. Lets name them Project Manager, Sponsor and Follow Project. Now when i open my dashboard i want to see projects filtered based on these three fields. Like if a person's name is present in either Project manager, Sponsor or Follow Project fields he/ she will be seeing the project. Solution:   First of all People picker controls are still a pain in PowerApps, by pain i mean they are still treated as a complex field, filtering, delegation and controls fail to respond on using them. So what we will do is create 3 single line textbox fields in Sharepoint.  Then we will refresh the data sourc...

Multi Person People Picker control in SharePoint list forms customized via Power Apps behaviour

Image
  Today i ran into a weird issue. I had a People picker control on my SharePoint list form. Just to give you a background of my situation. i am customizing a SharePoint list forms using Power Apps. Yes, it totally sucks, but client is the king and specially when you have government client. Problem: Client wanted to have a column, lets say "Follow Project" which will be a people picker column. This column will be used for following a particular project, on which they may not be working on but are interested in. Also not to forget the higher executive, who randomly wants to check a project. Solution: i created a people picker column in SharePoint and added it to my Power Apps customized SharePoint form. i quickly tested the functionality and i was able to save, view and edit the person value. But then i realized that let me make it more flexible so as instead of users groups can also be added. Also, why not enable multiple person. All this looked out of the box, so i went to my...

Sorting a SharePoint Cascading dropdown in PowerApps.

Image
  Simple sort function in Power App has the definition of Sort(Source, Expression, SortOption) i recently got a chance to work on using sort in a cascading dropdown. Nothing fancy in this its just you have always seen sort used with filter function in conjunction. But when you use it for a cascading dropdown you need to deal with one extra For All loop.  So your snippet looks something like below. ForAll(     Sort(Filter(         BusinessUnits,// SharePoint list with all cities          Division.Value = ddDivision.Selected.Value     ),Title,Ascending),     {         Value: Title,         // Create a new item with Value/Id, which will save correct          Id: ID// It's important to have Value as the first field!      } ) Remember sorting is done via the Title column and not the Division column.  Also, a bonus tip in ord...