Microsoft Certified Power Platform Functional Consultant Associate · Free Practice Question Medium

Question 29

Scenario: You are working at OZcorp which is a multi-million dollar company run by Mayor Norman Osborn. Profits from the company are used to fund Norman’s operatives, such as a police task force.

At the moment, you have been hired by OZcorp as a Microsoft Power Apps SME. Currently, the IT team is working with Power Apps and has created an application that shows pricing for various products. The prices however are not showing the currency formatting in dollars for the France / Spain region, which is required.

How can the formatting be changed to show the price with dollar signs in the required format ($999,99)?

  • A

    Select the price of the item, in the drop-down list of properties, select General, apply the formula Text(ThisItem.Price, "$ ##,00")

  • B

    Select the price of the item, in the drop-down list of properties, select Text, apply the formula

    Text(ThisItem.Price, "$ ##,00") 

  • C

    Select the price of the item, in the drop-down list of properties, select Number, apply the formula  Text(ThisItem.Price, "$ ##,00")

  • D

    Select the price of the item, in the drop-down list of properties, select Currency, apply the formula Text(ThisItem.Price, "$ ##,00")

Reveal correct answer

Correct answer: B

Explanation

Notice the comma as the dollar and cents separator - ($999,99).


When using Microsoft Power Apps, you don't have to write complicated application code the way that a traditional developer does. However, you must express logic in an app and control its navigation, filtering, sorting, and other functionalities. This is where formulas come in. If you've used Microsoft Excel functions, you should recognize the approach that Power Apps takes.


Formulas and properties

By default, the price appears as a plain number without a currency symbol. Suppose that you want to add a dollar sign and change the text colour based on the item's cost (for example, red if it's more than $5 but green otherwise). The following graphic shows the expected result.



By default, Power Apps pulls in a price value for each item. This value is set as the Text property of the label that shows the price.

1. In BrowseScreen1, select the price of the first item.



2. In the drop-down list of properties, select Text.

3. To add the currency symbol for dollars, set the Text property to this formula:



Note: If your formula returns an error, then please note that the language setting of your Power Apps environment can affect some separators and operators. For example, the above formula is expressed in a language and region that uses dot or period as the decimal separator, such as Japan or the United Kingdom. However, this same formula in a language and region where a comma is used for the decimal separator, such as France or Spain, the formula will need to be: powerappsfl Text(ThisItem.Price; "$ ##,00")

The property selection operator. (dot or period) in ThisItem.Price is always the same, no matter what the decimal separator is, but notice that the decimal separator and the chaining operation separator changed to a comma and semicolon respectively. Internally the formula doesn't change, all that changes is how it's displayed and edited by the author. See Formula separators and chaining operator for more information.


The Text function specifies how to format the number. The formula is like an Excel function, but Power Apps formulas refer to controls and other app elements instead of cells in a workbook.

If you select a control and then open the property drop-down list, a list of properties that are relevant to the control appears. For example, the following is a partial list of the properties for a Label control. Some properties are relevant across a wide range of controls, but others are relevant only for a specific control.



To conditionally format the price's colour, select the price Label and choose the colour property and set it to this formula:




Formulas included in the generated app

Power Apps uses a couple of formulas in every app that it generates. Both examples are from the browse screen and work with the OnSelect property. This property defines what happens when a user selects a control.

  • The first formula is associated with the IconNewItem1 control. Select this control to open the edit/create screen where you can create an item. To view the formula, select the New item icon and then select it in the formula bar. The formula is as follows:


  • The formula instantiates an edit page on the edit/create screen so that users can create an item. A value of ScreenTransition.None means that there's no transition, such as a fade, between screens.

  • The second formula is associated with the IconSortUpDown1 control Screenshot of the formula for the sort gallery icon items. Select this control to sort the items in the gallery. The formula is as follows:


  • The formula uses UpdateContext to update a variable called SortDescending1. The exclamation "!" symbol in the formula is a shortcut for the Not function. The value of the variable switches back and forth as you select the control. This variable tells the gallery on this screen how to sort the items.

  • The app contains many other formulas, so take some time to select controls and determine what formulas are set for various properties.

A. Selecting the General property and applying the formula Text(ThisItem.Price, "$ ##,00") will not result in the price being displayed with dollar signs in the required format for the France/Spain region. The Text property should be selected for the correct formatting.

B. The correct choice is to select the price of the item, choose the Text property, and apply the formula Text(ThisItem.Price, "$ ##,00"). This formula will format the price with dollar signs in the required format for the France/Spain region.

C. Selecting the Number property and applying the formula Text(ThisItem.Price, "$ ##,00") will not achieve the desired result of showing the price with dollar signs in the required format for the France/Spain region. The Text property should be selected for proper formatting.

D. Choosing the Currency property and applying the formula Text(ThisItem.Price, "$ ##,00") will not display the price with dollar signs in the required format for the France/Spain region. The correct choice is to select the Text property for proper formatting.

Discussion

Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.

You must be logged in to post a comment.

Preparing For

Your Certification?

255+ certifications
Detailed explanations
Free PDF samples

Has All The Questions You Need