-
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…
-
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…
-
Instantly format user number input before saving
Have you had the need to show a user the immediate formatted result before they save the input? Also after saving to a number field, existing data is displayed and saved in the same format, able to be edited again with a number. All of this is possible with a simple Text Input (example below is a Classic control, but will work with a Modern item using .Value instead of .Text ). Firsly, put this OnChange of the Text control. and the Format to Set the DelayOutput to Now the Default of the Text control (assuming an existing value needs to be displayed) If the Form is only used for new records and the Update of the Data Card Also Reset varInput after you save (OnSuccess of…
-
Simple effective editable Gallery
The following is a guide to constructing an editable gallery with the user able edit in-line records and save back to the data source. It has functionality to ensure only one record can be chosen and no others selected unless the target is saved or cancelled.NOTE: This example uses Classic controls you will need on some Modern controls to change to the equivalent references. Also the example uses SharePoint. Firstly, but this at Screen OnVisible Insert a blank Vertical Gallery and use a SharePoint List (or collection based on a SharePoint List) as the Items. Any normal filters can also be used. If ShowColumns are used, ensure that the ID…
-
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…
-
Enter time using a single drop-down with intervals (like Outlook)
Have you ever wanted to replace the two Hour & Minute drop-downs with a single drop-down showing set intervals (example here is 15 minute like Outlook).This is quite easy to do using a Date Picker and a single drop-down as below The Date Picker is a standard item (you can leave the one that Power Apps creates when a Date/Time field is added) and there are three settings you need to know (two on the drop-down – you can use the one provided for Hours if you want to and delete the Minute item) – the Items and Default and also the Update of the Data Card. Firstly the Items of the drop-down (in this case) reflects 15…
-
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…
-
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…
-
Changing the Authoring Version of an App
There are times unfortunately that Power Apps releases a new Authoring Version in the Design Studio that does not always perform as expected. Any app last saved in this new version may be affected by whatever the deficiency is and an updated version of an app with minor changes may suddenly develop unwanted characteristics. The easiest way to see if it is the version that is causing these issues is to re-publish the app on an earlier version, the best being the last one (before the most recent) it was saved in and was working properly. This is quite a straight-forward process, but can be a little confusing if you…
-
Rounding to the nearest .5
It is easy enough to round (nearest, up or down) to a specified number of decimal places, but what if you want to round to the nearest half? This is not something “standard in functions provided, so a combination of other things is required. Firstly, the code To explain how it works