-
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…
-
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…
-
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.
-
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…
-
Saving and displaying multi-choice Combo Box in a Text field
It is well documented how to save the contents of a multi-select combo box to a Single Line of Text field, but not so how to successfully get the content back into the DefaultSelectedItems of the control. I will do two examples here (both related) – one on a Choice field and the other on a list of items. Items referenced as follows Choice field Items Update of Data Card DefaultSelectedItems List Field Next is a list based on a field from another List) – I will refer to the elements as follows Items Update of Data Card DefaultSelectedItems and that is about the extent of the process. I hope this is useful to you.
-
Power Apps Controls and their References
Contents General When you start your Power Apps journey and start working with controls and their inputs and output references, there is a lot of confusion and misunderstanding that can be quite easily alleviated, saving you both time and potential errors. Initially, you had probably “left them alone” with the settings Power Apps provides when they were created, used SubmitForm() to save the data and all worked exactly as you expected. Now you are needing to refer to them in code and possibly change the settings in the control itself to meet your needs. All of this should not be overwhelming if you take a little time to understand a…
-
Starting your app – good practices
Planning your controls Now you have read my blog on Data Structure and have a great one in place, you are ready to get in and construct your app. You have put in a gallery and a form and are ready to write some code. What else do you have to do? Firstly, planning to lay a foundation for your app, you need to know “where everything is”. You will have to refer to all of your controls (screens, galleries, forms, controls) constantly in your code. You are assisted in this endeavor by the built-in IntelliSense function, which “predicts” what you might want to type and displays it in a…