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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Square foot to Square ...
Power Apps
Unanswered

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,297 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,297 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard