Showing results for 
Search instead for 
Did you mean: 
Super User
Super User

Patching a SharePoint List from a Collection

I have a canvas new-employee on-boarding checklist app connected to three SharePoint lists: Employees, Checklist, and Responses.



The Process:
1. The supervisor or the on-boarder clicks an employee's name in GalleryEmployees on Screen1 and navigates to Screen2, which displays GalleryChecklist
2. GalleryChecklist is filtered to display the checklist items for the logged-in user
3. The supervisor or the on-boarder chooses "Yes" or "No" in Dropdown1 for each checklist item and clicks the "Save" icon
4. The "Save" icon patches the "Yes/No" values to the Responses SharePoint list for the selected employee



The Structure:

App > OnStart:

// Store checklist items from Checklist SharePoint list
Set(colChecklistList, Checklist);

Screen1 > GalleryEmployees > Items:

// Display the list of employees from the Employees SharePoint list

GalleryEmployees > Icon > OnSelect:

// Store the selected employee's record
Set(varEmployee, ThisItem); Navigate(Screen2)

Screen2 > OnVisible:

// Add an "Answer" column to the collection to store the "Yes/No" value from Dropdown1
ClearCollect(colChecklist, AddColumns(ShowColumns(colChecklistList, "ID", "Title", "Category"), "Answer", "No"));

GalleryChecklist > Items:

// Filter gallery to only show checklist items based on the current user's role (either supervisor or on-boarder from Employees list)
If(varEmployee.Supervisor.Email = User().Email, Filter(colChecklist, Category.Value = "Supervisor"),
If(varEmployee.Onboarder.Email = User().Email, Filter(colChecklist, Category.Value = "Onboarder")))

GalleryChecklist > Dropdown1 > OnChange:

// Store "Yes/No" value in the collection based on Dropdown1's selection
Patch(colChecklist, ThisItem, {Answer: Dropdown1.Selected.Value})

GalleryChecklist > Dropdown1 > Default:


Screen2 > Save Icon > OnSelect:

// Upon saving, patch Responses SharePoint list with "Yes/No" values for selected employee
ForAll(Filter(colChecklist, Category.Value = "Supervisor"), If(Dropdown1.Selected.Value = "Yes",
Patch(Responses, {Title: Answer, ChecklistID: ID, EmployeesID:varEmployee.ID})));



My Questions:

1. Upon saving, how can I patch the "Yes" or "No" values to the Responses list for the selected employee (varEmployee)?

(My current approach adds a new list item (row) each time I click "Save". I'd like to update values if they already exist.)


2. If an employee has stored values in the Responses list, how do I retrieve those values and display them in GalleryChecklist?



Nice work mate. You got this setup fairly quickly, I'm impressed! All the best with the rest of your app development.

Helpful resources

October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

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.

Users online (3,992)