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 / Form not refreshing up...
Power Apps
Answered

Form not refreshing upon submit

(0) ShareShare
ReportReport
Posted on by 99

I’m running into an issue where my Edit Details form is not refreshing with new data once the form is saved. It is saving the data to my SharePoint list and if I navigate away from the page and back again the form shows the updated data. Here’s the background:

  1. On my gallery OnSelect property, I set a variable (varRecord) to ThisItem like this:

Set(varRecord,ThisItem); Navigate('Request Details Screen', ScreenTransition.None)

 

  1. On the Request Details screen I have an Edit form with the Item property set to varRecord
  2. On the Request Details screen, I have an Edit button that sets a variable called v_EditOn to true to change the form mode to edit.

Set(v_EditOn, true)

 

  1. The Save button OnSelect property is set to:

Patch('Spend Request',{ID:varRecord.ID},frm_ReqDetails.Updates); Set(v_EditOn, false); Refresh('Spend Request')

 

  1. The form’s OnSuccess property is set to: Refresh('Spend Request').

 

I also tried adding ResetForm(frm_ReqDetails) in the form OnSuccess and on the Save button…but no luck there.

 

I’ve read several posts where others were having the same issue, but I can’t seem to resolve this. I saw the suggestion to use Gallery.Selected instead of using the variable but I don’t think that’s an option for me. The reason I’m using varRecord is because I’m also using deep-links and accessing the detail screen from multiple different galleries.

 

Does anyone have any other suggestions for how to fix this?

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @tsparkman 

    I need a little more information before making a suggestion.  There is some missing information:

    • Is your gallery named 'Spend Request' or is that the name of your datasource?
    • What is the items property of the gallery? Please post the exact formula.
    • Is the Items property a collection or a datasource? 
    • Is your datasource in Excel, SharePoint, CDS or SQL?
  • tsparkman Profile Picture
    99 on at

    Hi @Drrickryp -

     

    Thanks for your quick response and your willingness to help! Below are answers to your questions:

     

    • Is your gallery named 'Spend Request' or is that the name of your datasource? Spend Request is the name of my data source.
    • What is the items property of the gallery? Please post the exact formula. The Items property of the gallery is as shown below:

    Filter(
    SortByColumns(
    Search(
    'Spend Request',
    input_Search.Text,
    "RefNum",
    "Title"
    ),
    varSortBy,
    If(
    varSortOrder,
    Ascending,
    Descending
    )
    ),
    'Created By'.Email = gbl_User
    )

    • Is the Items property a collection or a datasource? The items property is a data source, not a collection.
    • Is your datasource in Excel, SharePoint, CDS or SQL? The data source is a SharePoint list.
  • Verified answer
    Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @tsparkman 

    Thanks for the info.

    On the screen containing the gallery:
    There should be on an icon Inside the gallery like a ">" icon" with its OnSelect property

     

    Set(varRecord,ThisItem);
    EditForm(frm_ReqDetails);
    Navigate('Request Details Screen', ScreenTransition.None)

     

    to edit the record chosen in the gallery existing records.

     

    There should be an icon Outside the gallery for a New record, like a "+" icon with its OnSelect property

     

    NewForm(frm_ReqDetails);
    Navigate('Request Details Screen', ScreenTransition.None)

     

    to open the form in New mode to accept new records.

     

    On the 'Request Details Screen'

    The Datasource of the form should be 'Spend Request', 
    The Item property of the form should be 

     

    Lookup('Spend Request', ID = varRecord.ID)

     

    Get rid of the edit button, it is implicit in the icons inside and outside of the gallery.  There is no need for a patch and there doesn't appear to be a SubmitForm() function on your 'Request Details Screen'; the form's OnSuccess property will not fire without it. The Save button should have its OnSelect property 

     

    SubmitForm(frm_ReqDetails)

     

    instead of the Patch. 

     

    The OnSuccess property of the form should have:
    Back() or to Navigate to another screen of your choice, perhaps a "Success" screen to let the user know the submission succeeded.  I like

    Notify("Your data was successfully submitted", Success);
    Back()

     

  • tsparkman Profile Picture
    99 on at

    Hi @Drrickryp - Apologies that I am just now responding. I got pulled into another project last week and just now had a chance to try this out. Your solution worked perfectly! 

     

    Thank you so much!

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard