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 / Collections when patch...
Power Apps
Unanswered

Collections when patched to SharePoint stored as blank records

(0) ShareShare
ReportReport
Posted on by 603
I have a collection which is created onvisible of a screen. When i try to patch this collection to SharePoint list, it saves them however all the values are blank.
 
In preview mode of collection i can see value. However when the form is submitted, values are stored as blank. Is there any problem in my form OnSuccess property.
 
May i know why this happens?
 
 
Screen OnVisible
ClearCollect(
    yourSOEditCollection,
    Filter(
        'SO Details',
        System_List_ID = varedititem.ID
    )
);
Add button OnSelect
If(
    CountRows(SO_Gallery_1.AllItems) < 3,
    Patch(
        yourSOEditCollection,
        Defaults(yourSOEditCollection),
        {
            Name: "",
            Email: "",
            Designation: "",
            Contact: "",
            RandID: Rand(),
            System_List_ID: varedititem.ID
        }
    ),
    Notify(
        "You can only add upto 3 rows",
        NotificationType.Warning
    )
)
Edit icon inside Gallery OnSelect
UpdateContext({varEditItem: ThisItem.RandID})
 
 
Save icon inside Gallery OnSelect
 
If(
    varEditItem = ThisItem.RandID,
    Patch(
        yourSOEditCollection,
        ThisItem,
        {
            Title: TextInput4_12.Text,
            'SO Email': TextInput4_13.Text,
            'SO Designation': TextInput4_14.Text,
            'SO Phone': TextInput4_15.Text
        }
    );
    UpdateContext({varEditItem: Blank()})
)
Form OnSuccess
 
ForAll(
    yourSOEditCollection As EDITITEM1,
    Patch(
        'SO Details List',
        Defaults('SO Details'),
        {
            Title: EDITITEM1.Name,
            'ACSO Email': EDITITEM1.Email,
            'ACSO Designation': EDITITEM1.Designation,
            'ACSO Phone': EDITITEM1.Contact,
            System_List_ID: EDITITEM1.System_List_ID,
            RandID: EDITITEM1.RandID
        }
    )
);
 
Categories:
  • Meekou Profile Picture
    200 Moderator on at
    For your issue, you could check the value for yourSOEditCollection after clicking Save icon to check whether it has been update correct, and then check value for yourSOEditCollection before and  submitting the Form.
    Regards,
    Meekou
    Personal Support
     
  • ronaldwalcott Profile Picture
    3,914 Moderator on at
    Form OnSuccess does not run if you are using Patch only for Submit
  • WarrenBelz Profile Picture
    156,963 Most Valuable Professional on at
    I suspect there is something missing in what you posted - namely the code when you submit the Form and how this relates to the gallery  - also I assume that the Items of the Gallery is yourSOEditCollection. You seem to be editing a Gallery with up to 3 rows and then mention a Form - if you simply want to Patch the gallery contents, your code is correct, except you need to put it on a "save all" button/icon (as ronaldwalcott mentioned, you need to SubmitForm() for LastSubmit to exist)
     
    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee

     
     
     
     
     
  • WarrenBelz Profile Picture
    156,963 Most Valuable Professional on at
    A quick follow-up to see if you received the answer you were looking for or if you need further assistance.

    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps   

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 221 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 188 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 120

Last 30 days Overall leaderboard