Hello everyone
In my App I have a table called "Orders"
It contains a column called "Driver" of type REF
>> The "driver" column refs to a table called "Driver Ca"
>>> "Driver Ca" table contains a column called "driver" which stores the name of the driver and a column called "Email" which stores the driver email.
----------------
Now in the "Order" table I've added a new slice called "Delivery Ca" and I want to make a row filter condition where ....
if (driver) column in (order) table MATCHES (driver email) in (driver ca) table
then that row will be shown
I've tried with THISROW but it hasn't worked.
please any help
Solved! Go to Solution.
Thank you all, I've read some posts and finally I am able to solve it ๐
> Here is what I did:
โบIn "Driver ca" table I made Email column as a key.
โบ In slice " Delivery Ca" in table "Orders" I wrote this code to filter rows.
And(
[status]="Processing",
[Pickup Delivery]="Delivery",
USEREMAIL()=[Driver].[Email]
)
and now each driver can only see his/her own rows.
Thank you all indeed
@aminsaleh wrote:
if (driver) column in (order) table MATCHES (driver email) in (driver ca) table
Here's the row filter condition for what you literally said you need:
IN([Driver], Driver Ca[Email])
However, it sounds like you might actually need something else--based on your explanation, one of the following would be true, but likely there's instead something I'm misunderstanding
If you need something else, I suggest share screenshots of each table's columns from the app editor.
Hello @dbaum and thank you for your help
It did not solve my question
Let me elaborate a bit more. Kindly see below image:
You see the main table is "Orders" and it contains a column called "Driver"
and that column of type ref and it refs to another table called "driver ca" that stores driver name and email.
In the order table I created a slice called delivery and I want to make a Row filter condition delivery for specific driver only.
@aminsaleh wrote:
see below image
Your illustration confirms my understanding of your original post's outline of your table and column structure. So, that was clear.
@aminsaleh wrote:
if (driver) column in (order) table MATCHES (driver email) in (driver ca) table
This is probably what remains unclear. I think that the row filter expression I gave you matches this requirement, although we both noted that it's probably not what you actually need.
Maybe you want the slice filtered to the driver whose email matches the current user's email?
IN([Driver], Driver CA Slice[Driver])
.First off thank you very much for your kind support but I have tried everything and nothing helped.
I do not know what info I can share more. If I can give you an access that will be really great.
>> I've tried by making the column email in Driver ca table a unique key. then by making driver as a key and nothing helped in both cases.
>> Now driver ca table is as below:
>> Driver ca slice as below:
>> Slice "delivery ca" in the main orders table is as below:
>> Slice deliver ca show if condition is this:
In fact what I want to accomplish is simply to allow each driver to only see his own rows. each driver will have to login via Gmail to use the App by the way which is intuitive.
**Example:
If I have a driver called Mike and a driver called Moe
If mike logs in to the app and goes to delivery tab, he will only see rows that contains himself as a driver. and likewise for Moe.
Thanks indeed
ูAdd comma
@dbaum wrote:
A good way to accomplish that would be to use the Driver CA table's Email column as the table's key. Then, you can easily filter any table that references the Driver CA table by the current user's email.
This is still the most straightforward approach. For example, your current data structure requires every driver to have a unique name, which isn't dependable.
@dbaum wrote:
Given your current data structure, here's an alternate approach:
- Create a slice for the Driver CA table that contains only the current user's row.
Your screenshot for this slice shows that the slice has no row filter. Enter an expression that filters the table to only the current user--e.g., [Email] = USEREMAIL()
I have tried everything you said
I do not want to waste your time. I've sent you almost everything.
When I say I've tried everything I laterally mean everything.
I tried this [Email] = USEREMAIL() and tried many options. NOTHING helped.
BEST SOLUTION IS: I can add you on my app as an admin and you see it clearly from inside.
otherwise I will be just wasting your valuable time.
@aminsaleh wrote:
I tried
This expression doesn't make sense.
IN([Driver], Driver ca Slice[Email])
evaluates whether a row's value in the Driver column appears in the Driver ca Slice's Email column. Unless the Driver column contains email values, it will always return false
.USEREMAIL()
returns the current user's email. Regardless of whether #1 returns true
or false
, neither of those values will never equal the user's email.Is there any solution to work my way around it @dbaum
It is not a comma problem, I just sent you screenshot in my last comment before adding the comma. I know about that. that is simple intuitive.
But still I could not solve the main issue
I've just sent you a PM, kindly check it
In slice try this formula.
AND(
[Driver]=LOOKUP(USERMAIL(),"Driver ca","Email","Driver"),
[Status]="Processing",
[Pickup Delivery]="Delivery"
)
Thank you but did not help
Thank you all, I've read some posts and finally I am able to solve it ๐
> Here is what I did:
โบIn "Driver ca" table I made Email column as a key.
โบ In slice " Delivery Ca" in table "Orders" I wrote this code to filter rows.
And(
[status]="Processing",
[Pickup Delivery]="Delivery",
USEREMAIL()=[Driver].[Email]
)
and now each driver can only see his/her own rows.
Thank you all indeed
User | Count |
---|---|
17 | |
12 | |
5 | |
5 | |
5 |