Ok, so I turned on the Named Formulas and add the very complex contents of my Items property below. However, the when I try and put "galRequestsItems" into the Items property of the gallery it doesn't recognize it and gives and error "Expected Table Value". What am I missing? Thank you
galRequestsItems =
If(
isAdmin,// This section is the same as the User section below except it doesn't include the GUID compare in the Filter since Admins can see all requests
//Adding in section so that this is restricted based on the AssignedTo field for the the Admin unless they have clicked
//on the button to show all requests. Default should be their requests.
If (
varShowSubmittedRequests,
If(
varTab = "InProgress" || varStatus = "In Progress" || varStatus = "Returned",
//Get all the records that have an In Progress or Returned status, which are both valid for the InProgress Tab
(SortByColumns(
Filter(
CDMRequests,
Archived = 0 And (Status = "In Progress" Or Status = "Returned")
),
"Created",
SortOrder.Descending
)),
If(
//Get all the records that have an for the other statuses (except Archive) that have 1 to 1 association with the Tabs
varStatus = "Submitted" || varStatus = "Actively Reviewing" || varStatus = "Pending Pricing Review" || varStatus = "Sent for Approval" || varStatus = "Completed",
(SortByColumns(
Filter(
CDMRequests,
Archived = 0 And (Status = varStatus)
),
"Created",
SortOrder.Descending
)),
If (
//Get all the records that have been put on hold and should appear on the Hold Tab
varTab = "Hold",
(SortByColumns(
Filter(
CDMRequests,
Archived = 1
),
"Created",
SortOrder.Descending
))
)
)
),
If(
varTab = "InProgress" || varStatus = "In Progress" || varStatus = "Returned",
//Get all the records that have an In Progress or Returned status, which are both valid for the InProgress Tab
(SortByColumns(
Filter(
CDMRequests,
Archived = 0 And (Status = "In Progress" Or Status = "Returned") And UserGUID = varUserGUID
),
"Created",
SortOrder.Descending
)),
If(
//Get all the records that have an for the other statuses (except Archive) that have 1 to 1 association with the Tabs
varStatus = "Submitted" || varStatus = "Actively Reviewing" || varStatus = "Pending Pricing Review" || varStatus = "Sent for Approval" || varStatus = "Completed",
(SortByColumns(
Filter(
CDMRequests,
Archived = 0 And (Status = varStatus) And AssignedToGUID = varUserGUID
),
"Created",
SortOrder.Descending
)),
If (
//Get all the records that have been put on hold and should appear on the Hold Tab
varTab = "Hold",
(SortByColumns(
Filter(
CDMRequests,
Archived = 1 And AssignedToGUID = varUserGUID
),
"Created",
SortOrder.Descending
))
)
)
)
),
//This is the section just for users and will show all their requests because of the GUID comparison, each user has their own unique
If(
//Get all the records that have been put on hold by the user and should appear on the Hold Tab
varTab = "Hold",
(SortByColumns(
Filter(
CDMRequests,
UserGUID = varUserGUID And Archived = 1 And (Status = "In Progress" || Status = "Returned")
),
"Created",
SortOrder.Descending
)),
//The user will only see InProgress or Returned Requests unless they change the filter to show Submitted requests. In either case, Hold will not be shown
//except under the Hold tab
If(
varShowSubmittedRequests,
(SortByColumns(
Filter(
CDMRequests,
UserGUID = varUserGUID And Archived = 0
),
"Created",
SortOrder.Descending
)),
(SortByColumns(
Filter(
CDMRequests,
UserGUID = varUserGUID And Archived = 0 And (Status = "In Progress" || Status = "Returned")
),
"Created",
SortOrder.Descending
))
)
)
);