Lookup & showif for a view "possible"?

Hi guys, happy new year for everyone,

This time I have a question:

Im trying to “SHOW IF” a view, if certain value match with the criteria, but that specific value is within a enum column “which I don’t know if can be possible”.

So, everything is going fine when I do a lookup like this:

Lookup(Useremail(), “table_name”, “email_field”, “value”) =“criteria”

But what about if I don’t want to do it by the useremail (Because is not the key)?

I tried this but not success:

LOOKUP([_THISROW].[id_field], “table”, “id_field” , “value”)= “criteria”

It says:

can’t find [_Thisrow]

and I have the next warning message:

This formula is not evaluated in the context of a row, so column values are not available.

Solved Solved
0 5 181
1 ACCEPTED SOLUTION

Finally, I have made this worked with a Select from the tables, and then, just doing a lookup on the slice.

Just in case anyone needs to know how to do it.

On the table A:

SELECT( TableB[fieldsearched], [keyfrombothtables] = [_THISROW].[keyfrombothtables])

Then on the slice:

lookup(useremail(),tableC,“email”,“fieldsearched”) = lookup([_Thisrow].[fieldsearched],tableC,“keyfrombothtables”,“fieldsearched”)

That current_user Tips & Tricks, didn’t work for me because its “pulls” a value, no “GET” a value, which is what I needed, but thanks anyways for try to help @Kirk_Masden

View solution in original post

5 REPLIES 5

Hi! Happy new year!

I think the problem is that _THISROW doesn’t make sense as a condition to show a view because it’s not clear what row your are on. Also, I don’t think the fact that a column is of the enum type should prevent you from putting it in a “show if” condition.

I’m not sure exactly what LOOKUP() expression to suggest but it should be something without [_Thisrow] in it.

The problem is if I do like you suggets without the “_Thisrow” is this:

This formula is not evaluated in the context of a row, so column values are not available.

Is weird, but im just trying to force to obtain an specific field instead of useremail(), which is automatically created by appsheet, like a function.

You wrote that this worked:

I haven’t used USEREMAIL() but the following article says that it will return just one value – the e-mail address of the current user:

To make a LOOKUP() expression work as a show if condition for a view, you need to put a single value into that spot. If the value never changes you could just type that unchanging value directly in your LOOKUP() expression:

LOOKUP("Bob's Burgers", "Restaurants", "Name", "Phone")="382-9663"

The idea for this “Bob’s Burgers” example comes from the following article:

You may also want to consider this:

Actually, though, now that I’m taking another look at this “tip” I see that it explains how to make a USEREMAIL() slice and then use INDEX() instead of LOOKUP(). But I can tell you that the basic idea isn’t dependent on the use of USEREMAIL(). I use this combination of a one-row slice (determined by another criterion) with INDEX() to look up a value in a single cell that changes from time to time. So, I know it can be implemented without relying on USEREMAIL().

By the way, this technique also has the advantage of being more efficient than LOOKUP().

Thanks for your time and response Kirk, Im gonna test it and come back with news.

Finally, I have made this worked with a Select from the tables, and then, just doing a lookup on the slice.

Just in case anyone needs to know how to do it.

On the table A:

SELECT( TableB[fieldsearched], [keyfrombothtables] = [_THISROW].[keyfrombothtables])

Then on the slice:

lookup(useremail(),tableC,“email”,“fieldsearched”) = lookup([_Thisrow].[fieldsearched],tableC,“keyfrombothtables”,“fieldsearched”)

That current_user Tips & Tricks, didn’t work for me because its “pulls” a value, no “GET” a value, which is what I needed, but thanks anyways for try to help @Kirk_Masden

Top Labels in this Space