So I’ve got a bit of a complex setup where my users (in table roster) have an assigned business unit # (in table roster). Users make entries in a table (table daily_screen) and I need to filter who sees those screen entries based on the user_entry users’ business unit #s, and the current user’s entries in another table (business_unit_supervisor).
So all daily_screen entries have an employee_id which relates them back to the roster table where we find that user’s business unit. And the supervisors who review the daily_screens have one or more entries in business_unit_supervisor defining which daily_screens they should see.
I have an app formula which works in the row filter test, but when I actually save it, the slice view is empty.
Formula:
AND(
[create_timestamp] > TODAY() - 7,
IN(
ANY(SELECT(roster[bu_code], [employee_id] = [_THISROW].[employee_id])),
SELECT(business_unit_supervisor[business_unit_id], [employee_id] = NUMBER(ANY(SELECT(roster[employee_id], [email] = USEREMAIL())))))
)
@Nilson_Cain
The bare reason is you look for the employee_id with USEREMAIL() and the editor is reading your own email address to filter the table. If you want to test how any one of your white-labelled user see in the app, you can mimic their email address simply by entering their white-labelled email address to the Preview as property of the editor just above the mobile preview and then hit apply:
I have created entries for myself in the business_unit_supervisor table, so there are actually items in there that line up with my email address – we can see that it does work in the function test screenshot – there are daily_screen entries whose associated user business codes line up with entries matching my entries in business_unit_supervisor
@Nilson_Cain, did you ever find a resolution for this issue? I’m coming up with a similar issue related to granting users permissions to certain views.
I’m filtering a table called NodeES in a slice titled NodeES::Permissions using the following formula:
(MIN( EXTRACTNUMBERS("" & LOOKUP(USEREMAIL(), "DatabaseUsers", "UserEmail", "UserRoleNumber")))) <= (NUMBER(LEFT([NodeAccess], 2)))
The filtering formula works just like I want it to giving me this test output in case01:
You can see in the Expression Result column that there are 3 TRUE boolean values for views “403-Denied”, “Way”, and “User Profile”. However, my view only displays the last two items as you can see here:
I know that it’s definitely something to do with the slice filtering because when I remove the formula completely, all views show up just fine. Let me know if I can provide more information.
User | Count |
---|---|
43 | |
26 | |
24 | |
14 | |
12 |