Home > Software design >  How to add and display the suffix m² to a SharePoint number column in Powerapps
How to add and display the suffix m² to a SharePoint number column in Powerapps

Time:06-30

In a SharePoint list one column is declared as numeric, and with SharePoint's own "suffix adding tool" I assigned to the column value. The input 1000 is then correctly displayed in the list view as 1000 m².

But in the Powerapps customized form with this list as source, same DataCardValue is displayed only as 1000, without displaying .

DataCardValue default Format-Setting is => TextFormat.Number

...and I have already tried several things with it to display 1000 m², none works:

TextFormat.Number & "m²"
Parent.Default, "m²"
Text(Parent.Default, "m²")
DataCardValue3.Text & "m²"

Does anyone have a solution for this (without having to add an additional label)? Many thanks

CodePudding user response:

You could add a label on top of the input. Then conditionally show/hide the label based on the formMode. Users wouldn't see the "m²" when entering data into the form (aka form in edit mode), but they would see the "m²" when the form is in view mode.

enter image description here

Changing the format from number to text will allow you to do it, if that's an option.

enter image description here

You can also use the column formatting in SP list to add the suffix:

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "txtContent": "='@currentField'   'm²'"
}

enter image description here

  • Related