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 / Text box value doesn't...
Power Apps
Answered

Text box value doesn't get refreshed on the fly when updated in Powerapps screen on button click.

(0) ShareShare
ReportReport
Posted on by 603

Hi All,

 

I have text input in my screen which doesn't get refreshed when patched, unless I navigate between screens to see the updated value.

 

Text Input Default

If(Value(glbCurrentRecord1.'No of Openings Available')>0, glbCurrentRecord1.'No of Openings Available'&" openings left","Fully Occupied")

 

Patch formula when submit button is clicked

Set(
varPatchRecord,
Patch(
'Datasource',
glbCurrentRecord1,
{'No of Openings Available': Value(glbCurrentRecord1.'No of Openings Available') - 1}
)
);

Set(
glbCurrentRecord1,
varPatchRecord
);

 

I tried adding Refresh(datasource) and Reset(TextInput), but still I cant see the updated value on fly. If I navigate to another screen and come back to the current screen, I can see the updated value. Any idea how to solve this?

 

Please take note that I am not using any form. Just placed controls in the screen and patching based on button click

Categories:
  • Anchov Profile Picture
    1,986 on at

    Are you able to confirm that the variable glbCurrentRecord1 is being updated with the expected values after the patch event?

  • Iantaylor2050 Profile Picture
    603 on at

    Hi @Anchov 

     

    Yes values get patched successfully. No issues with that. Only problem is it doesnt refresh on the screen on fly.

     

    If I navigate between screens, I see the patched value which means patch is working fine

  • Verified answer
    Anchov Profile Picture
    1,986 on at

    @Iantaylor2050 , yes, I get that the patch is working correctly, but you are saving the patched record into a global variable called glbCurrentRecord1, right after the patch.  I have had issues in the past with saving a patch record into a Global variable, and I have used a collection instead with success.  Using the studio, you can check the state of the variable right after running the patch command.  If it is not updated as expected, this is likely your issue.

    Anchov_0-1670941895125.png

    When you navigate out and back in, your are probably doing a fresh initialization of this global variable directly from the data source, which may explain why that works.

     

    To use a collection instead, its a slight modification to your patch command:

    ClearCollect(
    colPatchRecord,
    Patch(
    'Datasource',
    glbCurrentRecord1,
    {'No of Openings Available': Value(glbCurrentRecord1.'No of Openings Available') - 1}
    )
    );
    
    Set(
    glbCurrentRecord1,
    First(colPatchRecord)
    );



     

     

  • Anchov Profile Picture
    1,986 on at

    you can also try updating the last command to:

    Set(
    glbCurrentRecord1,
    Lookup('Datasource', ID = First(colPatchRecord).ID)
    );



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