I have the same problem. If the Flow/SQL is returning an empty result, a red error popup is shown on the mobile devices, however not in the browser of a desktop/laptop.
The IfError solution is working on the desktop\browser but not on the mobile apps.
The solution is to make a query that is always returning at least one record. You have to add a 'dummy' record and remove that record from the local collection. You can do this with T-SQL command: UNION ALL
Example:
This is the sql query that is put in the label LabelSQLQuery:
"SELECT z.Project as Project,sum(z.aantaluur) as toturen
FROM
(SELECT d.Project,d.Aantaluur FROM doorgeboekteurenperpersoonpowerapps as d WHERE (d.Jaar+d.Week/100) >= " & (TextJaarStartFlow.Text) & "." & Left(Text(100*Value(TextWeekStartFlow.Text)/100;"[$-nl-NL]0#");2) & " And (d.Jaar+d.Week/100) <= " & TextJaarEindFlow.Text & "." & Left(Text(100*Value(TextWeekEindFlow.Text)/100;"[$-nl-NL]0#");2) & " And d.Persoon = '" & DropdownPersoonPeriodeFlow.Selected.Persoon
& "' UNION ALL SELECT 'dummy project' ,0) as z"
& " group by z.Project order by z.Project"
The part UNION ALL SELECT 'dummy project' ,0 adds a “ dummy” record to the result. So there is always at least 1 record returned by the sql server.
The flow is called from a button with the code:
ClearCollect(queryResults2;GetSQLQuery.Run(LabelSQLQuery.Text));;Remove( queryResults2;First( Filter ( queryResults2; Project="dummy project" ) ) )
The dummy record is removed from the collection with :
Remove( queryResults2;First( Filter ( queryResults2; Project="dummy project" ) ) )
If the dummy record is the only record from the query you see the record for a moment in the gallery before it is deleted. If there are more records, you cannot notice this at all.
I hope this helps and if someone has a more elegant solution, please let me know