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 / Details Form not displ...
Power Apps
Unanswered

Details Form not displaying updated record values

(0) ShareShare
ReportReport
Posted on by 716 Moderator

App has a Details Screen and an Edit Screen. And as I typed that, I realized that the solution to my challenge may be using just one page and form in View and Edit mode. I inherited the original app design so I didn't change it.

 

Be that as it may, here is the problem:

Choose a record in the gallery on the Browse screen which navigates to DetailsScreen. User clicks an Edit icon when takes them to the EditScreen.

User makes necessary changes and clicks Save. Save icon submits the form: SubmitForm(EditForm1);

The OnSuccess for EditForm1: 

 

Refresh('BusMarket - IBC PreSurvey');
Navigate(DetailScreen1, ScreenTransition.Fade);

 

 

But it always loads DetailsScreen with the old values in the displayed record even though they were just updated.

 

Categories:
I have the same question (0)
  • SpongYe Profile Picture
    5,603 Super User 2025 Season 2 on at

    Hi @DCHammer 

     

    Try adding on the OnVisible of DetailScreen1 the refresh:

    Refresh('BusMarket - IBC PreSurvey');

     

    If you have any questions or feedback, please let me know. Have a great day! 😊

    -----------------------
    PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]

    I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻

  • DCHammer Profile Picture
    716 Moderator on at

    I neglected to include that detail. I already tried that and the command is still there.

  • SpongYe Profile Picture
    5,603 Super User 2025 Season 2 on at

    Can you also try resetting the gallery on the OnSuccess for EditForm1: 

    Refresh('BusMarket - IBC PreSurvey');
    Reset('YourGallery');
    Navigate(DetailScreen1, ScreenTransition.Fade);

     

    If you have any questions or feedback, please let me know. Have a great day! 😊

    -----------------------
    PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]

    I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻

  • LaurensM Profile Picture
    12,516 Moderator on at

    @DCHammer,

     

    Refreshing your datasource is not necessary after a SubmitForm or Patch. When the user changes, adds or deletes a record in the datasource, your datasource will automatically refresh in that app instance.

     

    Should you use a variable (or collection) to display the data on the Details screen, make sure you update this variable in the OnSuccess of your form:

    //Example global variable
    Set(VariableName, Self.LastSubmit)

     

    I hope this helps!

  • DCHammer Profile Picture
    716 Moderator on at

    Already there. Still doesn't display the correct data. It's as if the form has cached data and I can't figure out how to update that cache.

     

    SubmitForm(EditForm1);
    UpdateContext({surveyVal: EditForm1.LastSubmit})

  • DCHammer Profile Picture
    716 Moderator on at

    That doesn't work because the form being displayed is a View form which can't be reset. 

  • LaurensM Profile Picture
    12,516 Moderator on at

    @DCHammer 

     

    UpdateContext will create a variable only available on the edit screen. Should surveyVal be a local variable (on the Details Screen), adjust your Form OnSuccess code to the following:

    Navigate(DetailScreen1, ScreenTransition.Fade, {surveyVal: Self.LastSubmit});

     

    Should you be using a global variable for surveyVal, use the following code in the OnSuccess:

    Set(surveyVal, Self.LastSubmit);Navigate(DetailScreen1, ScreenTransition.Fade);

     

    I hope this helps!

  • DCHammer Profile Picture
    716 Moderator on at

    That doesn't throw any errors but it doesn't solve the problem either @LaurensM.

    Here are two little screenshots:

    In the first, I'm showing the field that I've been modifying to test with. Simply incrementing a number at the end of a text field.

    The second image shows what I can look up in the variables area of PA when I stop the app immediately after the form loaded that generated the first image.

     

    DCHammer_0-1699306487355.png

     

    DCHammer_1-1699306520654.png

    It went from 9 to 11 because I tested twice without clicking through the gallery on the main page which would have results in TEST10 being there instead of TEST9. But it shows what is happening. Even though PA understands and shows that the underlying record for surveyVal contains the updated value, it's not showing in the form when that page loads.

     

    Now one more clue:

    The Item property for DetailForm1 is surveyVal.

    When I look at that variable I see two weird things:

    1. It's showing as a Context Variable on DetailScreen1 and not a Global.

    2. It shows the data for TEST9.

     

    And one more piece of evidence:

    The url I'm generating to get the user directly to the correct record on DetailsScreen1 results in no data displaying.

    ?surveyId=5 is embedded in the url. I thought my deep linking was broken because this link results in a blank page being loaded.

    BUT, today for some odd reason, I clicked the Edit button on DetailsScreen1 and low and behold, I was navigated to EditScreen1 with the right record visible. So riddle me that batman.

     

    I'm sure the problem is with the Item property on DetailsForm1 but how do you mess up 'surveyVal'?

     

    So the routing to the correct record on the EditScreen1:EditForm1 is very likely because the Item property of EditForm1 is userSurveys.Selected. 

     

    So surveyVal is setting correctly on AppStart and then through the gallery on the BrowseScreen otherwise DetailsScreen1:DetailsForm1 wouldn't show the correct record and it is. The problem appears to be updating the surveyVal record.

     

    If you've been reading, thanks for your patience. 😄

     

  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    @DCHammer 

     

    I did a few tests on my end and the update should work when supplied in the OnSuccess of your Edit Form. You could troubleshoot the issue by creating a new variable (e.g. called varSurveyValue).

     

    I used the following functionality:

     

    (1) Gallery Screen

    The OnSelect of the gallery contains code to save the selected row to a global variable:

    Set(varSurveyValue, ThisItem)

     

    (2) Details Screen (FormViewer control)

    Datasource property is linked to the same list as the Gallery Items property, the FormViewer Item property is set to varSurveyValue

     

    (3) Edit Screen (Edit Form)

    The Form also had the same List as Datasource and varSurveyValue as Item property. The OnSuccess code saves the LastSubmit to our global variable:

    Set(varSurveyValue, Self.LastSubmit)

     

    In this scenario, both the gallery and FormViewer contain the new data without a Refresh() function. Could you give it a try by using a new global variable? You may currently be updating the wrong variable or the wrong variable type (global vs local).

     

    I hope this helps!

  • DCHammer Profile Picture
    716 Moderator on at

    I'll take a shot at this today @LaurensM .

    And I believe your assessment 100%. It's in my variable handling. I just need to figure out where.

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard