Dynamic
-
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…
-
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
-
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…
-
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…
-
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…
-
Search and autofill in text box based on List values
We are all used to web searches giving suggestions of possible values you want and Combo Boxes have a Search function, but Text inputs do not have anything built-in for this, so it should be useful to have this function as well. In the example below, the user starts typing and all matching values come up below. At any time they can press Enter and have the first (or only) matching value populate automatically in the Text Box. The process involves only three things – changes to the OnChange and Default of the Text box and a Label below. This example is from a test list I have, but will work on any list subject to size Delegation…
-
Dynamic expanding multi-level menus
As users have become accustomed in many applications, top menus with context-sensitive sub-menus are the norm, but are not part of the standard Power Apps “suite”, so creating this type of function is a useful enhancement to user experience using a “look and feel” familiar to them.Firstly, the App and the Excel file (which is already imported) can be downloaded here. I will start this a bit backwards, showing the end result of a three-level menu based on a list as below and then discuss what needs to be done to accomplish this. These are galleries with one field in each: – To the right of these, there is a picture of…