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 / Patch/Gallery Question
Power Apps
Unanswered

Patch/Gallery Question

(0) ShareShare
ReportReport
Posted on by 1,265

The information below is a pic of a gallery that is based on a collection "Filter(colSFDetail,Title = Gallery1.Selected.Title).  The collection is obtained with 'ClearCollect(colSFDetail,ShortFormDetail)' and is run when the screen opens.  I have a New Record button that should perform Patch(ShortFormDetail,Defaults(ShortFormDetail),{SFDtlTitle: DataCardValue232.Text,SFCraft: " "}).  The patch appears to work with a new record created in 'ShortFormDetail'; however, it does not appear in the collection.  I have backed out of the screen and then reselected but the record is still not displayed.  Any suggestions?  

 

RJF61_0-1692279449756.png

 

Categories:
I have the same question (0)
  • TheRobRush Profile Picture
    11,128 Moderator on at

    Try this for your patch button

    IfError(
     Patch(
     ShortFormDetail,
     Defaults(ShortFormDetail),
     {SFDtlTitle: DataCardValue232.Text,SFCraft: " "}
     ),
    	 Notify("Please Try Again",NotificationType.Error), 
     ClearCollect(colSFDetail,ShortFormDetail)
     )

     

  • RJF61 Profile Picture
    1,265 on at

    @TheRobRush Thanks for the response.  The patch continues to work by adding a record to the ShortFromDetail list; but still does not display in the collection/gallery.  I also noted that the gallery does NOT refresh when a new primary record is added.

  • TheRobRush Profile Picture
    11,128 Moderator on at

    can you open 

    colSFDetail

    after the patch and verify it collected the new data that the IfError should have directed it to? If not maybe add a Refresh(ShortFormDetail); right before the clearcollect

  • RJF61 Profile Picture
    1,265 on at

    @TheRobRush That helped.  Based on your comment, I did find an error in the filter.  Now, the gallery does show the appropriate records; however, when I create a New Record the gallery displays incorrect information.  This is in the New Form action...

    ResetForm(frmShortFormMain);NewForm(frmShortFormMain);Clear(colSFDetail);Navigate(scrShortFormEntry,ScreenTransition.UnCover)

  • TheRobRush Profile Picture
    11,128 Moderator on at

    try placing this in the OnSuccess of your form

    Refresh(ShortFormDetail);
    ClearCollect(colSFDetail,ShortFormDetail)
  • RJF61 Profile Picture
    1,265 on at

    @TheRobRush No, same issue

  • TheRobRush Profile Picture
    11,128 Moderator on at

    Is the new items for sure being created, and is this the same gallery that displays the collection colSFDetail? Or is it a gallery that only displays the specific record just created, and if so what does it's items property look like

  • RJF61 Profile Picture
    1,265 on at

    Yes, the new item is being created.  When "ResetForm(frmShortFormMain);NewForm(frmShortFormMain);Clear(colSFDetail);Navigate(scrShortFormEntry,ScreenTransition.UnCover)" is selected a blank main form opens but the gallery displays data from the first record in ShortFormDetail.  When I save the new record, exit the screen and return, the gallery is accurate with no records (as expected).

    RJF61_0-1692288000119.png

    I do have Set(varDtlEdit,!varDtlEdit) in Edit Detail View button.  Could this be a part of the issue?

     

  • TheRobRush Profile Picture
    11,128 Moderator on at

    if gallery displaying collection should be empty after new submission maybe just clear that collection in the onsuccess of the form so it is also blank when you finish the entry? would that work?

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

#2
11manish Profile Picture

11manish 224

#3
Valantis Profile Picture

Valantis 181

Last 30 days Overall leaderboard