• Data,  Functionality

    Finding the newest versions of a criteria in a data set

    Have you ever wanted to find the newest/latest of all the different categories in a data set? For instance, the latest sale by each sales person, the last registration by a person – and generate a list of these. Firstly, a disclaimer here as the function used is not Delegable, however if all records you are looking for are in the newest 2,000 records, then read on. I am also assuming SharePoint as a data source in the example below. Firstly, the code required To explain what is going on here: –

  • Functionality

    Restricting users to specified file types in Attachment control

    This is a fairly straight-forward, but useful function to restrict users uploading attachments to file type specified. The example below restricts to JPG or PNG, but could be anything you choose. As soon as a non-allowed file is uploaded, it is immediately deleted and a message displayed regarding allowed file types. This code needs to go at OnAddFile in the Attachment control. You could also set a more prominent message label visibility off a variable triggered in the bottom If() statement if the Notification ribbon at the top is not sufficient.

  • Dynamic,  Functionality

    Combining two collections based on order alone

    There are times that you have two sets of data that you want to turn into one and they are actually “matching” in order, but have no common field. The number of fields in each does not matter, however you need to pick one (generally the one with the most fields), then add the fields from the other one. The example below only has one field in the first and two in the second, but show the principle of adding consecutive numbers to each and then joining them. This uses two collections – the collection process is only an example for testing and producing the resulting data sets to demonstrate…

  • Data,  Dynamic

    When you do not have to say true or false

    This is a misunderstood subject to some degree and once you grasp it, you will save a lot of unneeded code. Boolean (true/false) values can only have two possible outcomes. We are accustomed to Boolean fields (although they are best avoided for other reasons) , but all If() statements can only have one of two results (they are true or not). Some control properties are also Boolean results – for example Visible. When you want to set the Visible property of a control conditionally, you might say something like on a button So, if the control was checked, the button would appear. You can actually get rid of all the…

  • Design

    Alternate shading in Galleries

    One of the things that improves the presentation of an app and the readability of a gallery is if “every other” line was able to be shaded. There is no built-in function for this in Power Apps, but it can be done quote easily. The first thing you need to do is “number” the entries of the gallery. As you also may be sorting and filtering the gallery during the operation of app, this numbering needs to be dynamic to the gallery contents as it changes. The following is an example of a gallery with two filters based on a list, however it could be any sort and/or filtered gallery.…

  • Design

    Using Variables when you change the standard design

    You do not like the color scheme, font and sizes that Power Apps provides as “standard”. The Themes also do not exactly meet your needs. If you are going to make changes to the design, I recommend you go the extra effort and capture all of this at App OnStart in Variables. To explain, I generally use a colour scheme around a base colour (generally a dark one) with various shades of ColorFade on different elements. If you set this base color as a Variable (as well as the more commonly used lighter ones), you simply refer to these in the elements of all the controls. So for example (this is a really dark blue) Sets the base,…

  • Design,  Functionality

    The rogue wrap-around

    When you are designing a (particularly larger) form with a lot of fields and have many card widths different to the standard “equal width” automatically set by Power Apps, you get a long way in, change a card width and suddenly the whole screen of cards rearranges itself to something quite different than the items per line you planned? Sometimes this is a nightmare to fix (you fix one line and another breaks). So how do you avoid (or more accurately) mitigate the effect? Firstly, frequently you will have a need for different numbers of cards per line and within this naturally different card widths. You may also have a…

  • Design,  Functionality

    Duplicating a Canvas App Form into SharePoint Integration

    You have just finished your Canvas app and now you would like users to also have the facility directly from the SharePoint list. You already have the form in the Canvas App set out the way you want, and now need to duplicate this on SharePoint You may also have moved your SharePoint List and want to duplicate the existing Form to the new one. This is a perceived barrier that really is not one. A lot of people envisage having to maintain two apps or go for the integration option and have to manage the limitations this brings. Any screen or form created in a Canvas App or on…

  • Data,  Functionality

    Person Fields – reading and writing options

    There is often a challenge exploring the various options of searching and saving details into SharePoint Person fields, both single and multiple choice. This blog explores the various ways that Users can be chosen and saved. Standard choices There is often confusion around the “standard” provided Items which do not always provide a full list of employees. These Items only provide a choice of people already in the SharePoint List – if everyone is already in there, then this can be used, otherwise one of the other two options below is needed. Also, the syntax the Schema (Table structure) of a Person Field matches that of the Items Table, so no modification of the DefaultSelectedItems (Parent.Default or ThisItem.ThePersonFieldName) or Data Card Update (ComboBoxName.Selected or ComboBoxNameSelectedItems for multiple…