I have a Gallery that is accessed from several screens and I want it to update based on the information passed. I set the Gallery Item as a variable "Cases". I have four screens that navigate to this screen with the following variable onselect:Navigate(ClientCaseScreen,Transition.None,{Cases:SortByColumns(Filter('[dbo].[CaseTable]',ClientID=Client.ClientID), "IncidentDate", If(SortDescending2, Ascending,Descending))})
I get "The Function if has some invalid arugments" for the "If(SortDescending2, Ascending,Descending)"
I had it working for two of the screens but when I added a third screen it errored on all of them.
Solved! Go to Solution.
If the variable 'SortDescending2' is defined as local to a screen (using the UpdateContext function) then it can only be accessed from that screen. You can try changing it to a global variable: whenever you use the UpdateContext to set it, you change to use the Set function, which will define that variable in a way that it can be used in any screen.
Another alternative is to navigate passing only the client id for which you want to filter:
Navigate(ClientCaseScreen, Transition.None, {selectedClientID:Client.ClientID})
And use the filter in the gallery within that screen:
SortByColumns( Filter('[dbo].[CaseTable]', ClientID = selectedClientID), "IncidentDate", If(SortDescending2, Ascending, Descending))
If the variable 'SortDescending2' is defined as local to a screen (using the UpdateContext function) then it can only be accessed from that screen. You can try changing it to a global variable: whenever you use the UpdateContext to set it, you change to use the Set function, which will define that variable in a way that it can be used in any screen.
Another alternative is to navigate passing only the client id for which you want to filter:
Navigate(ClientCaseScreen, Transition.None, {selectedClientID:Client.ClientID})
And use the filter in the gallery within that screen:
SortByColumns( Filter('[dbo].[CaseTable]', ClientID = selectedClientID), "IncidentDate", If(SortDescending2, Ascending, Descending))
User | Count |
---|---|
153 | |
93 | |
83 | |
77 | |
58 |
User | Count |
---|---|
194 | |
176 | |
104 | |
96 | |
89 |