Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Submit Multiple Data in PowerApps Gallery to SharePoint List

(0) ShareShare
ReportReport
Posted on by 165

Hi, 

 

I need to submit multiple names to SharePoint List for attendance checklist. But the problem is, if I tick 4 checkbox only 1 latest one that were selected that will submit to the SharePoint list.

 

I have 2 button which are Presence and Absence.

NurSabrina24_1-1656474964589.png 

below is my SP List for the attendance checklist:

NurSabrina24_2-1656475205729.png

 

Here's my OnSelect for Presence button.

 

ForAll(colAttendees, Patch('SEMINDA Student Attendance Checklist', Defaults('SEMINDA Student Attendance Checklist'), {'Student Name': ThisRecord.'Display name', 'Class Name': ThisRecord.'Class Name'}))

 

Additionally, is there anyone know how to make the title the same function as ID? I didn't want the "true" result. I want it to be every time the SharePoint list has new item, title will +1 or have the long ID can too. 

 

Please help me if anyone knows how.

 

Thank you. 

  • NurSabrina24 Profile Picture
    NurSabrina24 165 on at
    Re: Submit Multiple Data in PowerApps Gallery to SharePoint List

    Hi, 

     

    Thank you, the code you give to me is right.

    The only problem why it runs but no data submitted in the SharePoint list is because my Title column is set as required in the SharePoint list. 

     

    And, I have accept your answer as solution. 

     

    Thank you. Both of you, @WarrenBelz @Aapok 

  • Aapok Profile Picture
    Aapok on at
    Re: Submit Multiple Data in PowerApps Gallery to SharePoint List

    Based on the posts in this thread, it looks like you're missing a ; after the patch function. I'm assuming the code to run the flow comes after your patch (like in your examples), and the missing ; is causing the error with @WarrenBelz 's code.

  • WarrenBelz Profile Picture
    WarrenBelz 145,445 on at
    Re: Submit Multiple Data in PowerApps Gallery to SharePoint List

    @NurSabrina24 ,

    The code I posted is valid if your references are also valid, so please check them. I cannot help you unless I know the error it is producing.

  • NurSabrina24 Profile Picture
    NurSabrina24 165 on at
    Re: Submit Multiple Data in PowerApps Gallery to SharePoint List

    Hi, 

     

    1. This code that you provided to me is the error. The whole code. 

    NurSabrina24_0-1656570075102.png

     

     

    2. For the title resulting true value is the one I use PowerApps button flow.. resulting the true value. (Before I changed it with your code, this is the code I used for OnSelect)

    ForAll(colAttendees, Patch('SEMINDA Student Attendance Checklist', Defaults('SEMINDA Student Attendance Checklist'), {'Student Name': ThisRecord.'Display name', 'Class Name': ThisRecord.'Class Name'})); PowerAppsAbsencebtn.Run(Checkbox2_5.Value, Label6_5, Label8); Collect(CombinedListsCollection, Checkbox2_5.Value); Set(NotifyVisible, true); Set(ResetCheckbox, true)

    This is the one for 2nd question I asked in my post. The full code I input in my OnSelect. The one that I put in the post is only within the first ; . 

     

    Hope it helps. Sorry for the misunderstand. Thank you. 

  • WarrenBelz Profile Picture
    WarrenBelz 145,445 on at
    Re: Submit Multiple Data in PowerApps Gallery to SharePoint List

    @NurSabrina24 ,

    That is not even close to what I posted. What is the error with the code I supplied ?

  • NurSabrina24 Profile Picture
    NurSabrina24 165 on at
    Re: Submit Multiple Data in PowerApps Gallery to SharePoint List

    Hi, 

     

    So for error is the whole code that you replied to me.

     

    And for the Title question, it is not through your code that it got "true" result. It's just before I use your code, I use PowerApps button flow to update the Presence/Absence status. I just called for the PowerApps button value, the display name (student name) and class name in the flow. So I guess that's why my Title result is true. So I want to know if anyone know how to change it to other than true result. 

     

    Here's my full code for the OnSelect; 

    ForAll(colAttendees, Patch('SEMINDA Student Attendance Checklist', Defaults('SEMINDA Student Attendance Checklist'), {'Student Name': ThisRecord.'Display name', 'Class Name': ThisRecord.'Class Name'})); PowerAppsAbsencebtn.Run(Checkbox2_5.Value, Label6_5, Label8); Collect(CombinedListsCollection, Checkbox2_5.Value); Set(NotifyVisible, true); Set(ResetCheckbox, true)

     

    Hope it answer your confusion. Thank you. 

  • WarrenBelz Profile Picture
    WarrenBelz 145,445 on at
    Re: Submit Multiple Data in PowerApps Gallery to SharePoint List

    @NurSabrina24 ,

    I was following your values posted assuming them to be valid. The syntax structure is valid if your values are. What is the error ? You have still lost me on the Title question - how does true get posted in there - it is not in the code you posted.

  • NurSabrina24 Profile Picture
    NurSabrina24 165 on at
    Re: Submit Multiple Data in PowerApps Gallery to SharePoint List

    Hi, 

     

    I've already try but it's an error. All are lined for the error.

     

    And for the question 2, I'd edited my post, where I inform the picture is my sp attendance checklist, and as you can see the title automatically submit as "true" instead of number.

     

    Thank you.

  • Verified answer
    WarrenBelz Profile Picture
    WarrenBelz 145,445 on at
    Re: Submit Multiple Data in PowerApps Gallery to SharePoint List

    Hi @NurSabrina24 ,

    Firstly try this

    Patch(
     'SEMINDA Student Attendance Checklist',
     ForAll(
     colAttendees As aPatch, 
     {
     'Student Name': aPatch.'Display name', 
     'Class Name': aPatch.'Class Name'
     }
     )
    )

    I am not sure what you mean by the second question. The ID will increment by 1 with each new record. Title is a Text column.

     

    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.

    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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,445

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,741

Leaderboard