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 / Replacing 'Field A' nu...
Power Apps
Answered

Replacing 'Field A' number field depending on the value of 'Field B' number field

(0) ShareShare
ReportReport
Posted on by 56

Hi all,

 

I have an issue that I cannot resolve and wonder if any of you can give me a sprinkle of your wisdom please 🙂

 

I have two whole number fields on a Power Apps form. Field A will contain a number and when in edit mode Field B may also contain a number depending on a calculation from on-the-fly drop-downs i've created (successfully calculated and uploaded to Field B!)

 

I am patching any changes on the form to Dataverse, which has been tested and works well, other than a potential number replacement (Field B to A).

 

What I am looking to achieve is if Field B has a number other than 0, this number will replace the Field A number in the form. I know it will be some sort of If statement and i've tried this for hours but with no luck. I never had any joy adding the If statement within the Patch either.

 

Its as simple or as hard as that in my case I think. If you need any further info then hit me up. Thanks a lot in advance.

Categories:
  • Verified answer
    Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @eel1 - if you're using a SubmitForm function, you can apply the below to the Update property of the DataCard for Field A:

     

    If(
     Value(FieldB.Text) <> 0,
     Value(FieldB.Text),
     Value(FieldA.Text)
    )

     

    If you're using a Patch function:

     

    Patch(
     'Your Data',
     LookUp(
     'Your Data',
     'Your Unique ID' = Gallery1.Selected.'Your Unique ID'
     ),
     {
     'Your Field A Number Column': If(
     Value(FieldB.Text) <> 0,
     Value(FieldB.Text),
     Value(FieldA.Text)
     ),
     'Your Field B Number Column': Value(FieldB.Text)
     }
    )

     

  • Verified answer
    eel1 Profile Picture
    56 on at

    Thanks Imran-Ami, works perfect!

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 232 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 202 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard