Skip to main content

Notifications

Power Apps - Building Power Apps
Unanswered

Collections when patched to SharePoint stored as blank records

Posted on 22 Nov 2024 04:16:43 by 490
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
        }
    )
);
 
  • WarrenBelz Profile Picture
    WarrenBelz 143,081 on 24 Nov 2024 at 06:14:34
    Collections when patched to SharePoint stored as blank records
    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

     
     
     
     
     
  • ronaldwalcott Profile Picture
    ronaldwalcott 716 on 22 Nov 2024 at 06:31:58
    Collections when patched to SharePoint stored as blank records
    Form OnSuccess does not run if you are using Patch only for Submit
  • Meekou Profile Picture
    Meekou 128 on 22 Nov 2024 at 06:16:36
    Collections when patched to SharePoint stored as blank records
    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
     

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

October 2024 Newsletter…

October 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #4 How to Conntact Support…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,081

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,795

Leaderboard