Posts

Showing posts with the label Power Apps

Containers in Power Apps.

Image
We have all tried to build responsive apps, failed and then stuck to the same default layout. Microsoft now has introduced containers in Power Apps. With containers MS has also introduced few new control properties. These properties are dependent on the direction property. So what does that mean. It means now you can develop apps by inserting controls inside these containers and you don't have to worry about responsiveness. Consider these containers as responsive wrapper around your App. Before this i use to leverage power apps forms control to achieve this, setting the height and with to App.Height and App.Width. So lets set first the app settings set. First of all we need to turn off the below features. Now if you come inside the app you, lets  add a container to your screen. The most basic one is the one in which you add a screen and then add container as an input control. Immediately you will see we have a whole list of new Properties to play with. Property like Direction has t...

Settings Items property of a Power App form via a Global Variable. Creating an item without using a New Form.

Image
 Today we will see an interesting scenario where in instead of setting the Items property to a list we assign it to Global variable. What happens in here is we use the same formula's that we use to patch a new item and patch an existing item into a list. But we tweak it a little. The advantage of this form is we don't need New Form, We can achieve everything using the EDIT form. So lets gets started.  Suppose you wish to open a New form.  All you will do is add the form on the screen. This form by default is EDIT, by EDIT i mean the display mode for this form is EDIT. So now we go to the screen from where we call in this from. Lets take an icon, you can even have a button if you want. Now OnSelect property of this button, we will need to initialize a variable that we will then put as the value of items property of the above form. Set(varFormData,Defaults(Programs));Navigate('Program Screen',ScreenTransition.Fade); What we do in here is we set a variable varFormData , an...

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...

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...

Power Apps: Antiquity

Workflows will soon be deprecated, but what is better is that its successor is even more powerful. And what a coincidence its even called as Power Apps. Being a SharePoint developer is tough, as your client considers anything and everything related to SharePoint as part of SharePoint. So if an app fetches and updates data in SharePoint list, then you got to know that app buddy. And that is precisely the reason i ended up exploring about Power Apps. I know i am a bit late to the party, but hey now most of the things are stable in MS Power sphere, and we will explore it to bits. Literally tear it!! There are two types of Apps Canvas Model Driven Apps Canvas Apps are UI centric apps and are basically used for the purpose of task or role based applications. All you need to do is drag and drop the controls. Connect the datasource using the awesome list of 200 plus and counting connectors and voila!  These are non responsive by default, and you have to do lots of work to make them resp...