web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Formatting lookup valu...
Power Apps
Answered

Formatting lookup value to currency and Patching to Sharepoint list as number

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi, currently working a powerapp which utilizes a sharepoint list. I have a text input which calls the most recent entry for pensionable earning and allows the user to edit this if there is a change. The submit button then submits the pensionable earning. Currently the pensionable earning is formatted as a number and submits to the sharepoint list as such, I would like for it to be formatted as a currency and rounded to two decimal places always ($758.00).

 

The syntax for the text input right now is as follows below.

LookUp(Sort('Pension Record',EAKey=EAKeyDropdown.Selected.Title,Descending),EAKey=EAKeyDropdown.Selected.Title,'Pensionable Earning')

 

KS1470_0-1675270683261.png

 

Any suggestions?

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    156,117 Most Valuable Professional on at

    Hi @Anonymous ,

    Something like this should do it

    Text(
     Round(
     Value(
     LookUp(
     Sort(
     'Pension Record',
     EAKey = EAKeyDropdown.Selected.Title,
     Descending
     ),
     EAKey = EAKeyDropdown.Selected.Title
     ).'Pensionable Earning'
     ),
     2
     ),
     "$##,##0.00"
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @WarrenBelz ,

     

    Thank you for that, it is now displaying the information as I wanted. The other problem now is that when a user changes the text input, for example clears it before entering a new value, it is not formatted properly. How can I correct a users input so that when they unclick the text input the value is automatically formatted as we want?

  • Verified answer
    WarrenBelz Profile Picture
    156,117 Most Valuable Professional on at

    Hi @Anonymous ,

    Assuming you are saving all this back as Text - On Change

    UpdateContext(
     {
     varFormatted:
     Text(
     Round(
     Value(Self.Text),
     2
     ),
     "$##,##0.00"
     )
     }
    );
    Reset(Self)

    then the Default of the Text box

    Coalesce(
     varFormatted,
     Text(
     Round(
     Value(
     LookUp(
     Sort(
     'Pension Record',
     EAKey = EAKeyDropdown.Selected.Title,
     Descending
     ),
     EAKey = EAKeyDropdown.Selected.Title
     ).'Pensionable Earning'
     ),
     2
     ),
     "$##,##0.00"
     )
    )

    and Screen OnVisible (or anywhere else you need to reset this)

    UpdateContext({varFormatted: Blank()})

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    HI @WarrenBelz ,

    This is great, now when I change the text input and click elsewhere on the screen the text input will refresh and format as desired. The problem now is that when I select a different EAKey from EAKeyDropdown, the pensionable earning value does not change, seems as if the lookup function is not working.

  • WarrenBelz Profile Picture
    156,117 Most Valuable Professional on at

    Hi @Anonymous ,

    I am a little unclear here on the issue - the Text Box Default should be the Variable if it has a value at the time - have you checked the Variable value ?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @WarrenBelz , sorry I should have clarified. If the textbox input value is changed and then the EAKeyDropdown value is changed, the textbox is not updated on the new EAKeyDropdown value selected. The textbox continues to display the inputted value instead of doing a lookup for the new value based on the new EAKeyDropdown value selected.

  • WarrenBelz Profile Picture
    156,117 Most Valuable Professional on at

    @Anonymous ,

    Assuming you are using SubmitForm, the Update of the Data Card should reflect the Text Box output - are you saying it is not writing to the data source ?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Correct, thank you for the clarification. Looks like there was an error on my part. It is working now, thanks!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 326 Most Valuable Professional

#2
11manish Profile Picture

11manish 168

#3
sannavajjala87 Profile Picture

sannavajjala87 75 Super User 2026 Season 1

Last 30 days Overall leaderboard