Data

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

  • Data,  Design

    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…

  • Data,  Design

    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…

  • 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: –

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

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

  • Data,  Functionality

    Displaying and saving time in 12 hour AM/PM format

    When Power Apps sets up a Date/Time field, the hours are in 24 hour format. Have you ever wanted to work with a 12 hour AM/PM choice and display for the user ? Here is how Add another drop-down at the right with Items and the Default of this drop-down Then you need to change the Items of the Hour drop-down to and the Default of the Hour drop-down Now the Update of the Data Card for the Hour dropdown This all should now allow you to perform this function