Contains useremail()

My expression is not working withe

USEREMAIL()

I have two tables:

 

First Table ( TASKS )

NO TASKS
1 Contact With AppSheet to Solve user's problem
2 Computer hardware request

 

Second Table ( TASKS WITH )

TASKS NO ID GMAIL
2 JOY USER1@GMAIL.COM
2 IZZAT USER2@GMAIL.COM
2 MOHMMAD USER3@GMAIL.COM

___________________________________________________________

In the slides, I used the following expression inside the row filter condition for the table (tasks), This is to show only the special tasks of the program user by e-mail

CONTAINS(USEREMAIL(),[Related TASKS WITHs][GMAIL])

 

 

 

3 Likes

Do you want to show only the related tasks with GMAIL = USEREMAIL()?

SELECT(Related TASKS WITHs[KEY], USEREMAIL() = [GMAIL])

Hi @perissf

[Related TASKS WITHs] names of Columns in table names TASKS , it will not work with this expression

SELECT(Related TASKS WITHs[KEY], USEREMAIL() = [GMAIL])

Ah ok sorry I didn’t read carefully the question. It’s a slice filter condition.
This should work:

IN(USEREMAIL(), [Related TASK WITHs][GMAIL])

CONTAINS() checks in a string, while IN() checks in a list.

3 Likes

This might be of help as well

2 Likes

@perissf

I can not see any Tasks registered in my e-mail If i use your expression

IN(USEREMAIL(), [Related TASK WITHs][GMAIL])


1 Like

I see the same problem in my test case as well.
@MultiTech_Visions since you have been here for a long time, can you explain this?
I see the filtered records correctly under Slice > View Data, and also in Test of the Row Filter Condition. But in the View there are no data.

2 Likes

@MultiTech_Visions

I can’t find what i’m looking about for my app in your link :slightly_frowning_face:

1 Like

You’re running into a rare and esoteric bug - but it’s not really a bug, it’s just a difference between how formulas are evaluated.

I tried to find the post from back in the Google+ days where Praveen was talking about this, but I couldn’t find it.


It deals with the fact that the Expression Assistant (and the whole “test my formula” thing) works using one formula evaluation engine…

  • and the actual app uses a different one.

While they’re nearly identical, there are some very rare instances where things don’t match up… like what you’re finding here.

Ultimately the solution is to change the formula you’re using

  • You need to find another way of accomplishing the same thing.

In your case:
image

I would try the following:

IN(UserEmail(), SPLIT(CONCATENATE([Related TASKS WITHs][GMAIL]), " , "))

Many times when you’re using a list dereference, you have to apply some “formatting” to it in order for the system to understand it.

  • (I imagine at some point this will be ironed out, but for now it’s necessary to make list dereferences work in some instances.)

If that doesn’t work…

Then what I would do is take your list dereference and make it an actual column - then use that column in your formula instead.

1 Like

Okay… Now that I’ve read everything a couple of times, I get it now.

You only want to create a slice of a table, where the child records of that table contain the email of whoever is using the app.

Final Answer

Inside your Tasks table, create a virtual column that list dereferences all the emails out of the [Related TASKS WITHs]

  • This way you have an actual list of emails on each task level.
    • Name: [Included_Emails]
    • Formula: [Related TASKS WITHs][GMAIL]
    • This should produce a list of emails

Then use that column inside your slice formula:

IN(USEREMAIL(), [Included_Emails])

5 Likes

You are a genius!
Nasty bug!!!
And very elegant solution!

2 Likes

@MultiTech_Visions
Really your a genius and im so happy for your help. i will try your idea now :blush:
@perissf Thank you for you help :blush:

3 Likes

 

I follow another way and work perfect, this my steps

  1. I create Slices name TASK WITH by table TASKS WITH with this expression USEREMAIL()=[gmail]

 

 

 

  1. From Data>Columns in my table TASKS i use in the virtual column [Related TASKS WITHs] this expression REF_ROWS("TASK WITH", "TASKS NO")

 

 

 

  1. From Element type details / Referenced table name i use my Slice name TASK WITH (Slice)

 

5 Likes

Outstanding solution write-up!

2 Likes