Data
-
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
-
Displaying Days, Hours and Minutes between two Date/Time values
Have you ever wanted to see exactly how many hours, minutes and seconds are between two selected date/time values. The formula below assumes that the user has selected from two Date Pickers with the Hour and Minute value from drop-down controls (as are provided by a standard Power Apps Date and Time field controls). To explain briefly the logic
-
Allowing a user to add a non-listed value to a multi-value field
I have used cbData for the Combo Box and MultiField for the field name in these examples. It is easy enough to allow a user to add a custom value to a single select Combo Box with a Data Card Update of so it simply uses the SeachText if entered and nothing is selected from it (or uses the selection as normal). But what about multi-select columns ? One fundamental issue here is that the SearchText is only accessible/visible when there are no other items selected, but we want to retain what is there presently and add the new item, so one compromise is the user needs to delete existing items that come up with the DefaultSelectedItems, but we can still retain…
-
Shift numbered items in a gallery by more than one row
There are many posts on reordering a gallery with up/down buttons, but what if you want to shift an item a large number of places and re-order everything in between in one action ? The assumption here is that the gallery contains a sequential numeric field, is sorted by this field and the user wants to change a row item to another position with the result that the gallery will then be sorted in the new order.Firstly, there are two possibilities on the number shift – it could be larger or smaller than its original position, so that needs to be dealt with separately. I have also allowed for there…
-
Distinct values for a large list field in Combo Box Items
This idea is an extension of a workaround in Combo Boxes dealing with large lists and the Delegation issues surrounding these and the Distinct function. I have tested this on a large list (30k items) and it works perfectly. Two caveats here – the number of items displayed in your combo box and the number of filtered items subject to the Distinct function (after the leading letters are entered) will both be subject to your Delegation Limit, but these should not generally be an issue. This example is using a big list Aircraft with a field Airline. The idea is to start typing the Airline name and all Distinct values starting with the input will then be avalable for selection in…
-
Show size of attachment or uploaded file
Have you ever wanted to show or use the size of an uploaded file – the process is below Attachment Firstly, you need a hidden image control with the Image Then on the OnAddFile (and OnRemoveFile if you want) Then the Label below has the Text Uploaded file A similar, but less complex process – on the OnChange of the AddMediaButton and the Label below All attachments on a record An expansion on #1 above – make a Gallery (called galAttach below) with the Items Now put an Image control in the Gallery (called imAttach below) with the Image You can now hide the gallery You will need to trigger the next piece, so a button with “Size” or…
-
Enter Time directly instead of drop-downs
Have you ever wanted to throw away the drop-downs that Power Apps supplies for time fields and simply have the user enter a valid time. For this you would also want to display the time currently stored in the data source and do both in an hh:mm format. It is not as difficult or complex as you may think and can also all be done within a SubmitForm() action using the Update property of the data card. Here are the steps required. Unlock the card and delete the two drop-downs for hour and minute and the separator and add a Text Control (I will call it TxtTime1 here and will use DateValue1 as the Date Picker name). Set the DelayOutput of…
-
Excel Data – Paste and Patch
Have you ever want to grab a block of Excel data, paste it and display in Power Apps, then patch it to your data source as new records? The process involves a bit of user discipline grabbing the correct columns, but it works. The first bit requires two controls – a Text Input set to multi-line and expanded appropriately and a HTML Text box for displaying the result in a structured manner. Below is an Excel sheet that has simply has the content copied and then pasted into the Text Input The top section is the Text Input and the bottom a HTML Text box with the HtmlText of This displays the data in a structured column manner…
-
Dynamically filtered multi-select check boxes
Firstly, my thanks for the inspiration for this to Reza Dorrani in his great video. Please refer to it if necessary for the checkbox gallery insertion process. I am now taking this a couple of stages further with: – A short example of it working is below Firstly, if the code seems a little over-complex, it is due to some refreshing issues I had in testing and the below seems to work as intended. It is based off a test list of PC devices, but can be applied to any similar structure. As I mentioned, the primary radio control is stored in a Text field. For the secondary filtered item, create a Choice type column (as…
-
Prevent the use of Special Characters in a Text input
This process prevents a user from saving a range of Special Characters if entered in a Text Input. This may have other application as well as the Text Box example. A working example is shown below So how does this work? Firstly do a Collection of all special characters (you can do this at Screen OnVisible) by using their ASCII value ranges. This puts 31 Special Characters into the collection under the field FieldNo.Below is a gallery (with wrap at 4) showing the characters Note you may want to allow some such as Underscore _ (95) and will have to adjust the above to suit.Now put this on the OnChange of the Text Box…