I am not sure whether my query is mainly Dataverse related, or mainly Power Apps related. A similar question (958293) did not help, although it does provide useful comments and a solution to that question.
I have basic canvas app relying on two Dataverse tables (one is the built in Accounts table) and a few reusable options lists. The built in accounts table (with slight modification, called Organisationen (German), to which my Besuchsberichte (German for visitation reports) table is linked. Only owners should see their organisations, and therefor only the reports belonging to their organisations.
After other options did not work, I modified the active (default) view of the custom Besuchsberichte table to ensure it contains only the rows belonging to the logged in user. I even went a step further and defined that the logged in user must be both owner of the report and owner of the organisation. So far so good: the view displays the filtered list correctly.
Here a screenshot of the quickview panel of the view 'Aktive Besuchsberichte':
Besitzer is German for owner.
I now use this view in a gallery with
*The three options look at reports a) regardless of date sent, b) only without date sent c) only with date sent.
The first filter dropdown also attempts to cater for three scenarios:
BTW: I do get delegation warnings on all levels of my Switch statement. The development team will have to look into this in years/months to come.
Here a screenshot of the screen showing a row that clearly belongs to my colleague (team leader).
By now, you'll want to see my code. I could have tried to replace all custom German names using fictitious English names, but I am not sure that it will be a more productive way to explain my circumstances.
Ansichten = Views
Zeitpunkt = DateTimestamp
The code in red font is what I suspect to be containing a mistake.
Switch(ddOrganisation.Selected.Value;
"Alle Organisationen";
Sort(
Filter(
Besuchsberichte; 'Besuchsberichte (Ansichten)'.'Aktive Besuchsberichte';
(
!(Organisation.Organisation = Blank()) &&
If(Radio1.Selected.Value=1; !(Organisation.Organisation = Blank()); If(Radio1.Selected.Value=2; 'Bericht gesendet am' = Blank(); !('Bericht gesendet am' = Blank())))
)
); Organisation.Organisation; If(varSortAsc; SortOrder.Ascending; SortOrder.Descending)
);
"...Weisen"; // orphans
Sort(
Filter(
Besuchsberichte; 'Besuchsberichte (Ansichten)'.'Aktive Besuchsberichte ohne Org';
(
Organisation.Besitzer = LookUp(Teams;Match.Email=User().Email) &&
Organisation.Organisation = Blank() &&
If(Radio1.Selected.Value=1; true; If(Radio1.Selected.Value=2; 'Bericht gesendet am' = Blank(); !('Bericht gesendet am' = Blank())))
)
);
Zeitpunkt; If(varSortAsc; SortOrder.Ascending; SortOrder.Descending)
);
// default
Sort(
Filter(
Besuchsberichte; 'Besuchsberichte (Ansichten)'.'Aktive Besuchsberichte';
(
Organisation.Organisation = ddOrganisation.Selected.Value &&
If(Radio1.Selected.Value=1; true; If(Radio1.Selected.Value=2; 'Bericht gesendet am' = Blank(); !('Bericht gesendet am' = Blank())))
)
);
Zeitpunkt; If(varSortAsc; SortOrder.Ascending; SortOrder.Descending
)
)
)
I cannot seem to edit my post, neither right after nor a few hours later. I want the second paragraph to read like this:
I have a basic canvas app relying on two Dataverse tables (one is the built in Accounts table, with slight modification) and a few reusable options lists. The accounts table, called Organisationen (German for organisations), to which my Besuchsberichte (German for visitation reports) table is linked. Users should only see their own organisations, and therefor only the reports belonging to them and their organisations.
Thanks
mmbr1606
22
Super User 2025 Season 1
stampcoin
17
ankit_singhal
11
Super User 2025 Season 1