Functionality

  • Functionality

    Enforce users to use current version of app when changes are published

    Have you ever wanted to ensure that users always use the current version of a Power App, particularly after important changes or bug fixes. You can do it quite easily with a control value in another list/table. Firstly add another list/table with one record – this can be used for other things such as counters etc. This example is called Parameters and includes a Number field called CurrentVersion and this contains the current App Version (example 2.15). Now put this OnStart of the app You need to update the gblThisVersion Variable each time you change versions, but only need to manually update the CurrentVersion in Parameters if you want to enforce version change. The gblNotCurrent Variable returns either true or false – false if gblThisVersion is the same or greater than the Parameter figure or true if…

  • Data,  Functionality

    Save Power Apps SharePoint offline data including Attachments without a Flow

    Have you wanted to save offline data in SharePoint, but also needed to include attachments. Here is a way to save, retreive and upload this data using only Power Apps. Note this example addresses new records only. Firstly you need a normal Edit Form (classic example here) with an attachment control (example named acAttachments). Data is entered as usual.  Now you need a Gallery (galAttachments – which you can hide) – with the Items property In the gallery are two controls – a Text Label lblAttachName with the Text property and an Image Control imgAttachContent with the Image property The Image control is needed to resolve the attachment content to the actual file content rather than the format an attachment control uses to reference them. When you are…

  • Functionality

    View PDF List attachments and Library files in PDF viewer

    The process for viewing SharePoint Library attachments in the PDF viewer has been well documented, but what about SharePoint List attachments ? This blog will discuss a fairly straight-forward method of adding this to the user experience. Firstly, you need a Gallery with the Items (if you only have PDF files, you do not need the Filter). You can put the Name (Text Label with ThisItem.Name ) and possibly an Image control with the Image property of Note that this will not resolve the thumbnail on a mobile device app. Now add an icon (Icon.DocumentPDF is a good one). You are also going to need the ID of the record that the files are attached to. The OnSelect of the icon (do not enter this…

  • Design,  Functionality

    Form control – add vertical multiple controls and single control on same line

    A question often asked is why multiple different height data cards cannot fit on the same line – essentially “stack” one column with multiple Cards.  Have you ever had a Form looking like this And you want it to look like this There is a really simple way of doing this (which seems obvious when you see it), using a standard Form and SubmitForm and moving a couple of controls. Firstly (in the example above) with a Columns setting of 2, So what is happening here? Essentially when you cut and paste (moved) the Text Input from the Type Data Card, it still retained its Update property linked to the Text Input you just moved to the Device Data Card, so it…

  • Data,  Functionality

    Patching a Collection to SharePoint with an attachment on the records

    This is something that there is no “standard” way of doing as saving an attachment directly from Power Apps requires an attachment control with either SubmitForm() or Patch(Form.Updates), however often the requirement is for records to be accumulated in a Collection (including possible offline saving) and then bulk updated to SharePoint. The workaround described below only works with a single attachment per record. Nested galleries do not seem to work on this. Firstly you have a Collection with an Attachment on each (or some of) the record/s. Insert a Gallery (you can hide it later) with the Items of the Collection and any other fields you want to Patch on Labels (though this is not strictly necessary).  Now…

  • 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…

  • 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…