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 / 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:
I have the same question (0)
  • Verified answer
    Ami K Profile Picture
    15,679 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

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 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard