cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Blair
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.

Thanks!

2 REPLIES 2
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

 

Regards,

Michael

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

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,940)