Showing results for 
Search instead for 
Did you mean: 
Level: Powered On

Create SP list item from Gallery Selection

Hi Folks,

I have two SharePoint Lists: 'Staff ID' and 'Staff Hours'.


I am trying to create an item in 'Staff Hours' when the item in 'Staff ID' is selected from a Gallery.
Trying to use the Patch Function but doesn't seem to work, just wonderinf if anyone could offer some help.


Super User
Super User

Re: Create SP list item from Gallery Selection

That should be possible. What does your patch code look like? 

Shane - Microsoft MVP, YouTube, and PowerApps Consulting for when you are in a bind to get this fixed quickly. And finally we now have PowerApps Training
Community Support Team
Community Support Team

Re: Create SP list item from Gallery Selection

If would be more helpful if you could share more details about the actual fields stored in your two SharePoint list.

Assuming you have the Staff ID stored in the Staff hours List, when creating new record for the selected Staff ID, the patch () function should be written as:

Patch('StaffHours', defdaults('StaffHours'), {StaffIDField:Gallery1.Selected.StaffID, DateField: DateValue})

For more information about the Patch, see:

Patch function in PowerApps




Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources


Watch Sessions On Demand!

Continue your learning in our online communities.


PowerApps Monthly Community Call

Next Wednesday, September 18th at 8am PDT

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020


Power Platform World Tour

Coming to a city near you


PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!


Join PowerApps User Group!!

Connect, share, and learn with your peers year-round


Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 201 members 4,771 guests
Please welcome our newest community members: