I can find no conditionals or errors which would prevent the update. I have used a label to verify that the On Visible IS being invoked -- but the collection is NOT being updated when returning from the update on Screen 2. I have tried forcing a refresh of the list when leaving Screen 2, but Screen 1 still does not update. I have tried returning to Screen 1 with a Navigate rather than a Back, but Screen 1 still does not update. Yet when I exit from Screen 1 to the Home Page and invoke Screen 1 again, it DOES update.
Here's the On Visible code:
Set(
RptPopUpVisible,
false
);
Set(StartDate,DateAdd(dpWeekEndDate.SelectedDate,-6));
Clear(multiList);
// Skeleton structure of what is about to happen:
//
// ForAll(shaped and grouped Data,
// collect-departments into multiList;
// ForAll(projects in department groups,
// collect-projects into multiList;
// ForAll(stones in project groups,
// collect-Accomp into multiList
// )
// )
// )
ForAll(
//We need to group two levels - one for the inner accomplishments grouped by Department and Project (records are the (Accomp)lishments)
//We need to compare a few things in the later levels, so we also need to add the department and project in the
// appropriate places - this will speed up the lookups in the ForAlls
SortByColumns(
GroupBy(
SortByColumns(
AddColumns(
GroupBy(
AddColumns(
SortByColumns(
Filter(
PA,
Archive = false
),
"Title"
),//Sort the list so Accomplishments (PA) are in order
"dep",
DepartmentName.Value,
"proj",
ProjectName.Value
),//AddColumns - Put the dep and proj on the records of all milestones
"dep",
"proj",
"accomp"
),// LEVEL 2 GroupBy - group by the department and project and give us a table of accomp
"depL2",
dep
),// AddColumns add the department at LEVEL 2 as well (but a different name)
"proj"
),// SortBy Project Column
"depL2",
"Projects"
),// LEVEL 1 GroupBy - finally group by the Department with a table of projects
"depL2"
),// SortByColumns - Sort by Department Column
//The stage is set....Now lets collect some records
// DEPARTMENTS
// Here we are on the outside of the groups - we have a Department column and a table column of Project Records
// REMEMBER: we are in a ForAll function - this is the FIRST statement of the ForAll...a Collect function
Collect(
multiList,
//Every record in our final collection should have a DataLevel (used only during this compilation, a DepLevel, which is the caclulated Department
//level, a Project Level - a calculation of the project level, and a milestonelevel - also calculated
{
DataLevel: 1,
// we use the datalevel for our filter statements only, this is level 1
DeptLevel: CountRows(Filter(multiList, DataLevel = 1)) + 1,
//count the number of rows in our collection that are at this datalevel, we should be the next one
ProjLevel: 0,
// we're at the department level now, so all records have 0 project
PALevel: 0,
// we're at the department level now, so all records have 0 PA
myDept: depL2,
//and of course, the real data...the department name at this point is all we care about
sortKey: Text(CountRows(Filter(multiList, DataLevel = 1))+ 1,"[$-en-US]000") & "000" & "000"
}
);
// PROJECTS
// Now lets collect with the Departments' Projects - here we go into the Projects tables of the group
// REMEMBER: we are in a ForAll function - this is the SECOND (and last) statement of the outer ForAll...this final statement is a ForAll
// Here we are working with the Projects table column from the outer group LEVEL 1
ForAll(
Projects,
Collect(
multiList,
{
DataLevel: 2,
// we use the datalevel for our filter statements only, this is level 2
DeptLevel: LookUp(multiList, myDept = dep).DeptLevel,
// in this level, we look up the department level for this department that was collected before
ProjLevel: CountRows(Filter(multiList, DataLevel = 2)) + 1,
// count the number of rows in our collection that are at this datalevel, we are the next one
PALevel: 0,
//we're at the project level now, so 0 PA
myDept: depL2,
//and of course, the real data...the department name
myProject: proj,
// and the project name
sortKey: Text(LookUp(multiList, myDept = dep).DeptLevel,"[$-en-US]000") & Text(CountRows(Filter(multiList, DataLevel = 2)) + 1,"[$-en-US]000") & "000"
}
);
Collect(
multiList,
{
DataLevel: 3,
// we use the datalevel for our filter statements only, this is level 2
DeptLevel: LookUp(multiList, myDept = depL2).DeptLevel,
// in this level, we look up the department level for this department that was collected before
ProjLevel: CountRows(Filter(multiList,DataLevel = 2)), // we look up the project level for this project that was collected before
PALevel: 1, //we're at the project level now, so 0 PA
myDept: depL2, //and of course, the real data...the department name
myProject: proj, // and the project name
PA: "Accomplishments",
PAType: " ",
sortKey: Text(LookUp(multiList,myDept = depL2).DeptLevel,"[$-en-US]000") & Text(CountRows(Filter(multiList, DataLevel = 2)),"[$-en-US]000") & "001"
}
);
// ACCOMPLISHMENTS
// we are in the Projects grouping...so let's grab the Accomp as well now
// REMEMEBER: We are the second statement in the Last statement of the outer ForAll
// Here we are working with the Accomp table column from the inner group LEVEL 2
ForAll(
Projects[@accomp],
Collect(
multiList,
{
DataLevel: 3, // we use the datalevel for our filter statements only, this is level 3
DeptLevel: LookUp(multiList, myDept = dep).DeptLevel, // in this level, we look up the department level for this department that was collected before
ProjLevel: CountRows(Filter(multiList, DataLevel = 2)),
// we look up the project level for this project that was collected before
//now count the rows that are associated with the dept and proj - we are the next one.
PALevel: CountRows(Filter(multiList, myDept = depL2 && myProject = proj && DataLevel = 3)),
// And finally, all the real data that we need for the final list
myDept: depL2,
myProject: proj,
PA: Title,
PAD: AdditionalDetail,
PAType: "A",
RptDate: StatusDate,
ID: ID,
sortKey: Text(LookUp(multiList, myDept = dep).DeptLevel,"[$-en-US]000") & Text(CountRows(Filter(multiList, DataLevel = 2)),"[$-en-US]000") &
Text(CountRows(Filter(multiList, myDept = depL2 && myProject = proj && DataLevel = 3)),"[$-en-US]000")
}
)//end of accomp Collect
)// end of accomp ForAll
)// end of Projects ForAll
);
// end of grouped ForAll
//REPEAT THE ENTIRE PROCESS FOR NEXT STEPS BUT ONLY WRITE OUT THE NEXT STEPS HEADER AND DATALEVEL 3 RECORDS
//We need to group two levels - one for the inner next steps grouped by Department and Project (records are the Steps)
//We need to compare a few things in the later levels, so we also need to add the department and project in the
// appropriate places - this will speed up the lookups in the ForAlls
ForAll(
SortByColumns(
GroupBy(
SortByColumns(
AddColumns(
GroupBy(
AddColumns(
SortByColumns(
Filter(
NextSteps,
Archive = false
),
"Title"
),//Sort the list so NextSteps are in order
"dep",
DepartmentName.Value,
"proj",
ProjectName.Value
),//AddColumns - Put the dep and proj on the records of all NextSteps
"dep",
"proj",
"Steps"
),// LEVEL 2 GroupBy - group by the department and project and give us a table of Steps
"depL2",
dep
),// AddColumns add the department at LEVEL 2 as well (but a different name)
"proj"
),// SortBy Project Column
"depL2",
"Projects"
),// LEVEL 1 GroupBy - finally group by the Department with a table of projects
"depL2"
),// SortByColumns - Sort by Department Column
//The stage is set....Now lets collect some records
// PROJECTS
// Now lets collect with the Departments' Projects - here we go into the Projects tables of the group
// REMEMBER: we are in a ForAll function - this is the SECOND (and last) statement of the outer ForAll...this final statement is a ForAll
// Here we are working with the Projects table column from the outer group LEVEL 1
ForAll(
Projects,
Collect(
multiList,
{
DataLevel: 3,
// we use the datalevel for our filter statements only, this is level 2
DeptLevel: LookUp(multiList,myDept = depL2).DeptLevel,
// in this level, we look up the department level for this department that was collected before
ProjLevel: LookUp(multiList, myDept = depL2 && myProject = proj && DataLevel = 2).ProjLevel,
// we look up the project level for this project that was collected before
PALevel: CountRows(Filter(multiList, myDept = depL2 && myProject = proj && DataLevel = 3)),
//we're at the project level now, so 0 PA
myDept: depL2,
//and of course, the real data...the department name
myProject: proj,
// and the project name
PA: "Next Week",
PAType: " ",
sortKey: Text(LookUp(multiList, myDept = depL2).DeptLevel,"[$-en-US]000") &
Text(LookUp(multiList, myDept = depL2 && myProject = proj && DataLevel = 2).ProjLevel,"[$-en-US]000") &
Text(CountRows(Filter(multiList, myDept = depL2 && myProject = proj && DataLevel = 3)),"[$-en-US]000")
}
);
// NEXT STEPS/NEXT WEEK
// we are in the Projects grouping...so let's grab the Steps as well now
// REMEMEBER: We are the second statement in the Last statement of the outer ForAll
// Here we are working with the Steps table column from the inner group LEVEL 2
ForAll(
Projects[@Steps],
Collect(
multiList,
{
DataLevel: 3,
// we use the datalevel for our filter statements only, this is level 3
DeptLevel: LookUp(multiList, myDept = dep).DeptLevel,
// in this level, we look up the department level for this department that was collected before
ProjLevel: LookUp(multiList, myDept = depL2 && myProject = proj && DataLevel = 2).ProjLevel,
// we look up the project level for this project that was collected before
//now count the rows that are associated with the dept and proj - we are the next one.
PALevel: CountRows(Filter(multiList,myDept = depL2 && myProject = proj && DataLevel = 3)),
// And finally, all the real data that we need for the final list
myDept: depL2,
myProject: proj,
PA: Title,
PAD: AdditionalDetails,
PAType: "N",
RptDate: StatusDate,
ID: ID,
sortKey: Text(LookUp(multiList, myDept = dep).DeptLevel,"[$-en-US]000") &
Text(LookUp(multiList, myDept = depL2 && myProject = proj && DataLevel = 2).ProjLevel,"[$-en-US]000") &
Text(CountRows(Filter(multiList, myDept = depL2 && myProject = proj && DataLevel = 3)),"[$-en-US]000")
}
)//end of Steps Collect
)// end of Steps ForAll
)// end of Projects ForAll
);
// end of Group ForAllThe OnSelect that applies the update on screen 2 is:
Patch(Audit,Defaults(Audit),{Title:"Next Steps",UpdateDate:Now(),DepartmentName:{Id:LookUp(Department, Dept in Title,ID),
Value: Dept,'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"},
ProjectName:{Id:LookUp(Projects, Proj in Title,ID),
Value: Proj,'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"}});
SubmitForm(EditNext);Patch(Department,First( Filter( Department, Title = Dept ) ), { DataLastUpdt: Today() } )And the Success event for the form is simply:

I just can't find anything that should be causing this to occur...