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 / Square foot to Square ...
Power Apps
Answered

Square foot to Square Meter Calculation inside of form

(0) ShareShare
ReportReport
Posted on by 29

Hello, I am trying to create the Sqft to Sqm conversion inside of only 2 number fields. Imagine I have a form with only two fields, one sqm and one sqft. Can I code it so that if I enter sqft into one field, the sqm field updates and vice versa, if I enter the sqm, the sqft field calculates.

 

Do I need to create variables to do this? or can I achieve it with an if statement or do I need to create a proxy field somewhere (which I am trying not to do, but I could.)

 

thanks!

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Jakel 

    Because PowerApps is modeled after Excel and is not a development platform/language, trying to make what you want happen directly will result in a circular reference.  So, luckily, PowerApps has the ability to set a variable to aid in this.

     

    However!!!  I have one question for you - what happens if someone enters a number in Sqft AND in Sqm?  What is your logic for that scenario?

  • Jakel Profile Picture
    29 on at

    I would expect that if I changed the sqm value, then the sqft value would change, but I do not think powerapps has a "live state" for fields and it would crash and burn (not update). 

     

    Reason for this is because I have a bit of sprawl in my records already, and adding more columns for sake of calculating, doesn't seem like the proper way to approach this.

     

    We get data in square feet and square meters and I I need to create a record for the item/project in either or depending on the user and client providing the data. Some might give sqft and some might give sqm. 

     

    I suppose, we could just pick the lesser evil, sqm and use it as our basis, but honestly we are 50/50 in receiving both formats and I want my users to process the data as quickly as possible.

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Jakel 

    Well, the reason I ask on the condition is to determine if you would rely on the OnChange action of the text input or if a "calculate" button would suffice.  The button would be more dependable, but in your case, the OnChange will have to do.

     

    So, for your Sqft input, set the OnChange action formula to:

    UpdateContext({lclSqft: Self.Text});
    UpdateContext({lclSqm: Value(Self.Text) * 0.09290304});
    Reset(SqftTextInputControlName);
    Reset(SqmTextInputControlName);

    Then Set the Sqm input OnChange action formula to:

    UpdateContext({lclSqft: Value(Self.Text) * 10.763910417});
    UpdateContext({lclSqm: Self.Text});
    Reset(SqftTextInputControlName);
    Reset(SqmTextInputControlName);

    Then set the Default of the Sqft Input control to: lclSqft

    And the Default of Sqm Input control to: lclSqm

     

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 505

#2
WarrenBelz Profile Picture

WarrenBelz 502 Most Valuable Professional

#3
Haque Profile Picture

Haque 324

Last 30 days Overall leaderboard