When the app opens it shows a schedule for the current week in a series of 3 galleries. While it appears that the first item in the first 2 galleries is selected, it is not populating all of the information in the 3rd gallery. Some of the information is obtained when an item in gallery 2 is selected. I need to duplicate the OnSelect action from the 2nd gallery to happen in the onVisible of the screen so the information in the 3rd gallery is populated correctly when the app is initially opened.
What I tried to do is take that same formula and put it in the onVisible for the screen, and modified the items from 'ThisItem.PrimaryContact' to 'GalleryOnCallTeam.Selected.PrimaryContact. No errors or red squigglies, but it's not getting the information either.
All 3 galleries are using information from colSptSchedule. The 3rd Gallery is also using collections: Primary, Backup, Escalation and Primary2.
colSptSchedule:
ForAll(
OnCallSchedule As SC,
Collect(
colSptSchedule,
{
PrimaryContact: If("," in SC.PrimaryContact, First(TrimEnds(Split(SC.PrimaryContact,","))).Result, SC.PrimaryContact),
PrimaryContact2: If("," in SC.PrimaryContact, Last(TrimEnds(Split(SC.PrimaryContact,","))).Result, ""),
BackUpContact: SC.BackUpContact,
Date: SC.Title,
EscalationManager: SC.EscalationManager,
ScheduleNotes: SC.ScheduleNotes,
TeamNotes: LookUp(TeamsSupportInfo, Title = SC.Team).Schedule_x0020_Notes,
Team: SC.Team
}
)
),
Gallery #1 - GallerySchedule - Items:
GroupBy(
Filter(
colSptSchedule, Date = Text(Monday) Or Date = Text(Friday)),
"Date", "Details"
)
Gallery #2 - GalleryOnCallTeam Items:
Filter(colSptSchedule, Date = GallerySchedule.Selected.Date)
Gallery #3 - GalleryOnCallTeamInfo Items:
GalleryOnCallTeam.Selected
Formula that populates Primary, Backup, Escalation and Primary2. I copied this and added it to the OnVisible for the screen, replacing the 'ThisItem.XXX References with 'GalleryOnCallTeam.Selected.XXX'. It works correct when an item is manually selected in the 2nd gallery, but does not collect any information for Primary, Backup, Escalation or Primary2 in the OnVisible of the screen.
Concurrent(
With(
{wFilterPrimary:
LookUp(ITContacts, Email = ThisItem.PrimaryContact)
},
ClearCollect(Primary,
{
Number: wFilterPrimary.WorkPhone,
Type: "Business Phone: ",
Order:
If(
wFilterPrimary.PrimaryAfterHoursPhone.Value = "Business Phone", 1,
wFilterPrimary.PrimaryAfterHoursPhone.Value = "Mobile Phone", 2,
3
)
},
{
Number: wFilterPrimary.CellPhone,
Type: "Mobile Phone: ",
Order:
If(
wFilterPrimary.PrimaryAfterHoursPhone.Value = "Mobile Phone", 1,
2
)
},
{
Number: wFilterPrimary.HomePhone,
Type: "Home Phone: ",
Order:
If(
wFilterPrimary.PrimaryAfterHoursPhone.Value = "Home Phone", 1,
wFilterPrimary.PrimaryAfterHoursPhone.Value = "Other Phone", 4,
3
)
},
{
Number: wFilterPrimary.Other_x0020_Phone,
Type: "Other Phone: ",
Order:
If(
wFilterPrimary.PrimaryAfterHoursPhone.Value = "Other Phone", 1,
4
)
}
)
),
With(
{wFilterBackup:
LookUp(ITContacts, Email = ThisItem.BackUpContact)
},
ClearCollect(Backup,
{
Number: wFilterBackup.WorkPhone,
Type: "Business Phone: ",
Order:
If(
wFilterBackup.PrimaryAfterHoursPhone.Value = "Business Phone", 1,
wFilterBackup.PrimaryAfterHoursPhone.Value = "Mobile Phone", 2,
3)
},
{
Number: wFilterBackup.CellPhone,
Type: "Mobile Phone: ",
Order:
If(
wFilterBackup.PrimaryAfterHoursPhone.Value = "Mobile Phone", 1,
2
)
},
{
Number: wFilterBackup.HomePhone,
Type: "Home Phone: ",
Order:
If(
wFilterBackup.PrimaryAfterHoursPhone.Value = "Home Phone", 1,
wFilterBackup.PrimaryAfterHoursPhone.Value = "Other Phone", 4,
3
)
},
{
Number: wFilterBackup.Other_x0020_Phone,
Type: "Other Phone: ",
Order:
If(
wFilterBackup.PrimaryAfterHoursPhone.Value = "Other Phone", 1,
4
)
}
)
),
With(
{wFilterEscalation:
LookUp(ITContacts, Email = ThisItem.EscalationManager)
},
ClearCollect(Escalation,
{
Number: wFilterEscalation.WorkPhone,
Type: "Business Phone: ",
Order:
If(
wFilterEscalation.PrimaryAfterHoursPhone.Value = "Business Phone", 1,
wFilterEscalation.PrimaryAfterHoursPhone.Value = "Mobile Phone", 2,
3)
},
{
Number: wFilterEscalation.CellPhone,
Type: "Mobile Phone: ",
Order:
If(
wFilterEscalation.PrimaryAfterHoursPhone.Value = "Mobile Phone", 1,
2
)
},
{
Number: wFilterEscalation.HomePhone,
Type: "Home Phone: ",
Order:
If(
wFilterEscalation.PrimaryAfterHoursPhone.Value = "Home Phone", 1,
wFilterEscalation.PrimaryAfterHoursPhone.Value = "Other Phone", 4,
3
)
},
{
Number: wFilterEscalation.Other_x0020_Phone,
Type: "Other Phone: ",
Order:
If(
wFilterEscalation.PrimaryAfterHoursPhone.Value = "Other Phone", 1,
4
)
}
)
),
If(
!IsBlank(ThisItem.PrimaryContact2),
With(
{wFilterPrimary2:
LookUp(ITContacts, Email = ThisItem.PrimaryContact2)
},
ClearCollect(Primary2,
{
Number: wFilterPrimary2.WorkPhone,
Type: "Business Phone: ",
Order:
If(
wFilterPrimary2.PrimaryAfterHoursPhone.Value = "Business Phone", 1,
wFilterPrimary2.PrimaryAfterHoursPhone.Value = "Mobile Phone", 2,
3
)
},
{
Number: wFilterPrimary2.CellPhone,
Type: "Mobile Phone: ",
Order:
If(
wFilterPrimary2.PrimaryAfterHoursPhone.Value = "Mobile Phone", 1,
2
)
},
{
Number: wFilterPrimary2.HomePhone,
Type: "Home Phone: ",
Order:
If(
wFilterPrimary2.PrimaryAfterHoursPhone.Value = "Home Phone", 1,
wFilterPrimary2.PrimaryAfterHoursPhone.Value = "Other Phone", 4,
3
)
},
{
Number: wFilterPrimary2.Other_x0020_Phone,
Type: "Other Phone: ",
Order:
If(
wFilterPrimary2.PrimaryAfterHoursPhone.Value = "Other Phone", 1,
4
)
}
)
)
)
)