cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NurSabrina24
Helper I
Helper I

Submit Multiple Data in PowerApps Gallery to SharePoint List

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. 

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

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

View solution in original post

9 REPLIES 9
WarrenBelz
Super User
Super User

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

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.

@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
Helper I
Helper I

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. 

@NurSabrina24 ,

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

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. 

@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.

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.

NurSabrina24
Helper I
Helper I

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 

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (3,136)