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 / Refreshing form data
Power Apps
Unanswered

Refreshing form data

(0) ShareShare
ReportReport
Posted on by 161

Good day,
I have a a gallery where a user selects an item. The OnSelect property of the button then Navigates to a form screen where some of the data in the form is prepopulated form the previous screen.

The user completes one entry and then the data is patched to sharepoint: Patch(CSNonMovingParts, LookUp(CSNonMovingParts, Title=DataCardValue28.Text), {SVO: DataCardValue1.Text, 'Requested by': User().Email, 'Requested on': Now(), Status: "Requested"})

However, I am adding the user name and the date the form was submitted to sharepoint. What I'd like to see is that the form is refreshed and that the two fields REQUESTED BY and REQUESTED ON now contain data and that the field STATUS now say REQUESTED and not AVAILABLE .

MJGreyling_0-1631499966372.png

 

 

U have tried everything I could find that was suggested including setting the OnSuccess property of the edit form to REFRESH(SHAREPOINTLIST NAME) but it doesn't work.

 

Any ideas?

Categories:
I have the same question (0)
  • Digital Profile Picture
    1,207 on at

    What is in the Items property of your form? 

     

    Try putting a lookup to the datasource in the items property of your form so it is always looking up the latest record.

     

    For example:

     

    LookUp(CSNonMovingParts, ID=varSelectedID)

     

    Where varSelectedID is the ID of the currently selected record. You can set this in the Gallery OnSelect.

     

     

  • MJGreyling Profile Picture
    161 on at

    The Item property of the form has: selectedId in. This I had to do to get the form to populate the data coming from the gallery.

    I thought if I took your suggestion and put it in the OnSuccess Property it would work BUT i get Incompatible types: (It does the same if I do it in the ITEM property)

    MJGreyling_0-1631502182200.png

     

  • Digital Profile Picture
    1,207 on at

    You could try setting a variable in the gallery on select e.g.

     

    Set(varSelectedItem,ThisItem)

     

    Then in the Form's OnSuccess

     

    Set(varSelectedItem,Form1.LastSubmit)

     

  • MJGreyling Profile Picture
    161 on at

    In the OnSelect property of the Gallery the variable selectId was already set:

    Navigate(Screen1, ScreenTransition.Fade); Set(selectedId, ThisItem)

     

    So in the OnSucces property of the Form I have:

    Set(selectedId,EditForm3.LastSubmit)

     
    still doesn't refresh the form data. 

  • Digital Profile Picture
    1,207 on at

    In OnSuccess try looking up the submitted record in the datasource...

     

    Set(selectedId,LookUp(YourSPL,ID = EditForm3.LastSubmit.ID))

     

  • MJGreyling Profile Picture
    161 on at

    Lol. I am realy thinking this is impossible to do.
    No, didn't work. The record updates in SP but not on the form.

    Set(selectedId,LookUp(CSNonMovingParts,ID = EditForm3.LastSubmit.ID))

     

  • WarrenBelz Profile Picture
    153,040 Most Valuable Professional on at

    Hi @MJGreyling ,

    @Digital is on the right track, but the critical item which you have not included is the Item of the Form.

    If you have the OnSuccess as 

    Set(selectedId,Self.LastSubmit.ID)

    and the Item of the Form

    LookUp(
     CSNonMovingParts,
     ID = selectedId
    )

    it will display the record in its current state after the form submission.

     

  • MJGreyling Profile Picture
    161 on at
    Set(selectedId, Self.LastSubmit.ID)

    So for the above I get an incompatible type error from the formula

    And the same for this:

    LookUp(CSNonMovingParts,ID = selectedId)
  • WarrenBelz Profile Picture
    153,040 Most Valuable Professional on at

    @MJGreyling ,

    That is probably because you have selectedId defined elsewhere is a Record - forget about that one and use this

    OnSuccess 

    Set(gblID,Self.LastSubmit.ID)

    and the Item of the Form

    LookUp(
     CSNonMovingParts,
     ID = gblID
    )

    It has to work - I use it on many of my forms to show new records immediately after creation in edit or view mode on the same form.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

  • MJGreyling Profile Picture
    161 on at

    Ok. I'm gonna give up on this now. It has become to frustrating.
    Your suggestion has taken me back to square 1.
    Now the form does not populate at all. 😄

     

    The selectId is defined in gallery, under the OnSelect property

    Navigate(Screen1, ScreenTransition.Fade); Set(selectId, ThisItem)

    Im gonna take a brake from this. it is driving me nuts.

     

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard