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 / Update Label or Contro...
Power Apps
Unanswered

Update Label or Control based on change from Text Input

(0) ShareShare
ReportReport
Posted on by 15

In my current set up, I am working with a large On-Premise Database data set; TRUCKLOG : 40,000 records.  I display a limited amount of this data in a gallery, TRUCKGALLERY, based on filtered criteria where LOADS<>INVOICED. From here, I have users "form fill" other information with some editable TEXT INPUTS. The user then clicks the UPDATE button, which saves all updated information by creating a collection TRUCKCOLLECTION, and then click the SUBMIT button, which patches everything through to back to the database.

 

Problem: The above works fine, UNTIL my TRUCKGALLERY has more than 15 records. It takes forever because it is patching the whole TRUCKCOLLECTION,  even if there was no change in the record.  I was wondering of there is any way to identify and ONLY collect records that have been changed in the TRUCKGALLERY. 

 

Attempts: I added a label "RECORDCHANGE", and set this to "N".  I am currently trying to change it to "Y" whenever there is a change to any of the editable fields. This is so that when the user clicks UPDATE, the app can just collect the TRUCKGALLERY where RECORDCHANGE = "Y".  I have not been successful in doing this, because can not find anything that changes RECORDCHANGE to "Y". The closest I have reached with no errors was by adding 'CHANGERECORD'.Text = "Y" , to the OnChange field of the Editable Text Inputs, but it does absolutely nothing. 

 

Is there another property that can successfully change RECORDCHANGE to "Y"?

Is there perhaps another way to identify and ONLY collect records that have been changed in the TRUCKGALLERY? 

 

 

 

 

Categories:
I have the same question (0)
  • notj Profile Picture
    782 on at

    If your text values are in an edit form, you can patch back just the form. This is much quicker.(Code Below).

    If you're not using a form, you can still use the code below but your patch will look different where the forms are listed. You would just have your fields. 

     

    I think you could probable benefit from reading up on the patch command. 
    Patch function - Power Apps | Microsoft Docs

    PowerApps Patch Function with examples - SPGuides

     

    Patch(
     'TRUCKLOG',
     Defaults('TRUCKLOG'),
     Form1.Updates,
     Form4.Updates,
     Form5.Updates
     )

     

  • joeyb1215 Profile Picture
    15 on at

    Ok, so this somewhat works. I didn't use any forms. I do not believe I can. I need to show my information in somewhat of a Excel Base View.

     

    Material Display.PNG

     

    It patches directly to the database with the following: 

     

    ForAll(TRUCKGALLERY.AllItems,
    (Patch(TRUCKLOG, ThisRecord,{Material: RPTJOBDET_MAT.Text, ETC.} )))

     

    However it is still taking long if my Gallery displays 15+ Rows. I would prefer to collect only records that have been updated and then patch those through.  

  • notj Profile Picture
    782 on at

    There's probably better ways to do this, but my initial thought is you need something that shows that the record has been modified and then you patch only those.

     

    You could add a checkbox that the user will check  and then only patch records where the box is checked. 

     

    If you don't want to have the user check the box, you can add some logic to evaluate if the record in the gallery has been modified and check the box automatically.

     

    Then you would modify your patch to only patch records where the box is checked.

  • joeyb1215 Profile Picture
    15 on at

    That is exactly what I am trying to do. 

    From Initial Post: 

    " I was wondering of there is any way to identify and ONLY collect records that have been changed in the TRUCKGALLERY. 

    Attempts: I added a label "RECORDCHANGE", and set this to "N".  I am currently trying to change it to "Y" whenever there is a change to any of the editable fields. This is so that when the user clicks UPDATE, the app can just collect the TRUCKGALLERY where RECORDCHANGE = "Y".  I have not been successful in doing this, because can not find anything that changes RECORDCHANGE to "Y". The closest I have reached with no errors was by adding 'CHANGERECORD'.Text = "Y" , to the OnChange field of the Editable Text Inputs, but it does absolutely nothing. "

     

     The logic is what I currently need help with. I would like to not put the identification process in the hands of the user. I foresee a bunch of user errors with that. I also could not get the check box to work either. Do you have the proper code for that? Again I added 'CHANGERECORD'.Text  = "Y"  ('.Value = True' for the Check Box) , to the OnChange field of the Editable Text Inputs. It showed no errors but it did absolutely nothing. 

     

  • notj Profile Picture
    782 on at

    There's a whole bunch of ways to do this, and I'm sure one is better than the others. 

     

    We might be overthinking this. Why not just add the patch to the OnChange for the fields you want to keep track of?

     

    Patch(
     TRUCKLOG,
     ThisItem,
     {
     HAULNUM: haultextbox.text
     }
    ))

    Whenever you change the value, it patches that record back.

     

     

  • joeyb1215 Profile Picture
    15 on at

    This was one of my first designs; it was very glitchy. After I entered my first field, I would  tab over to start filling other fields, and it would reset my inputs and and pull me out of focus. I imagine this was the writing that was taking place, and the data source refreshing after. I would have to click back into the fields and retype everything it reset, ultimately waiting close to 3 to 4 full seconds after every input. With the amount of data being entered, that can't happen. 

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 551

#2
WarrenBelz Profile Picture

WarrenBelz 430 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 298

Last 30 days Overall leaderboard