Hi all,
I hope someone can help!
Summary
I have an issue on a Canvas app which records an approve/reject decision on a Gallery record.
The decision is only being recorded for the first 5 records within the Gallery. I suspect this is because the Patch is only applying to the rendered rows within the gallery.
Requirements
The original data is in a SharePoint List, each row in the App has a drop down to approve/reject, and there is an "Approve All" button and a "Reject All" button at the bottom. If either button is pressed it sets the decision on each row to Approve or Reject, then a Submit button is shown. Before you press submit you have the opportunity to review each row and check the decision is correct. Some Approvers aren't then checking the decisions and instead going ahead and clicking the Submit button straight away.
In an ideal world, what I'd like to happen is that when the Approve/Remove all buttons are clicked, the Approver is forced to scroll to the bottom of the data before the Submit button is shown (I cannot have the button within the gallery itself)
Alternatively, if that isn't possible, just submitting the decision to all records that are in the filter, whether they are rendered or not would be acceptable.
App Build
Within the app, we have two galleries:
"galUsers" which shows a list of Users which require an Approve/Remove decision. Once you click on a row, the "galRoles" gallery is updated.
"galRoles" which shows all the roles the selected user has and gives the option to Approve/Reject for each row
Filter('SharePointTable', 'End User Name' = galUsers.Selected.Value)
The Approve All and Reject all buttons simply sets the Context:
UpdateContext({DecisionValue: "Approve"})
On the Submit button, I thought this would work in the Visibility selection:
If(Not(CountRows(Filter('SharePointTable', 'End User Name' = galUsers.Selected.Value))=galRoles.AllItemsCount),false,true)
Alternatively, the Submit button OnSelect was set as:
ForAll(galRoles.AllItems, Patch('SharePointTable', {ID:ID}, {ManagerDecision: {Value: comboDecision.Selected.Value}, Status: {Value: "Complete"}}))
If further info is needed let me know!
If anyone has a solution, I will owe you a drink!