If the default icon selection is not sufficient for your apps needs you can always use any image you choose and display it in [image] control, this can be all you need for the app.
However, this option has its limits, e.g. if you use uploaded image you can only use it in colour it came, there is not many options in terms of customization, and you will have to upload new edited image each time.
The same goes for the size, if you use .jpg or .png or other raster images you will have to make sure to upload good size image to maintain quality and that may end up being quite a large file.
There is a solution to expanding your icon selection, while keeping small file size, excellent scalability, and easy colour customization options thanks to one experimental feature of PowerApps!
Enter Formulas and UDFs.
To accomplish all I’ve mentioned we will need an icon of your choice but instead of uploading a raster file we will use an SVG code instead.
As you can see, I’ve marked a section of the code in both examples, those parts of the code are describing the colour, you will have to do some hunting on your own and locate which sections correspond to which colour of the SVG. Keep an eye on the next code snippet as it will show how to replace that hardcoded colour code with a parameter we will be able to change from within the app.
To make full use of PowerApps UDF functionality we will define those colours as parameters,
Syntax looks like this:
FunctionName(Parameter1:DataType1, Parameter2:DataType2):OutputDataType = Formula
FunctionName – used to invoke the function
Parameter – the name of the input. One or more inputs are allowed
DataType – argument passed into the function must match this data type
OutputDataType – output of the function will be in this data type
Formula – the result of this formula is the output of the function
Following this instruction, we will define out icon: