Hi, I have a question on creating an expression. The below table is called โProductโ.
I have another view created from another table that require the field โGTINโ. Under the โGTINโ field, I want to create an expression that read back to the โProductโ table. What I want is to filter by USEREMAIL() and select the GTIN that is the most recent added. For example, if I login in using mary@gmail.com, the GTIN value that I want to obtain will be โ9556108261009โ.
For example, if I login in using edmund@gmail.com, the GTIN value that I want to obtain will be โ931048834115โ.
In short, I would like to select the latest GTIN value based solely on the useremail login.
I have created the expression but it does not work.
Solved! Go to Solution.
In what way doesnโt it work? No result? Result for a different user? Not the latest GTIN for the current user?
For testing, you need to login to the app as the test user. It may not be sufficient to use Preview As in the app emulator of the app editor.
Hello @lala_land, how about this expression?
INDEX(SELECT(Product[GTIN],USEREMAIL()=[_THISROW].[Useremail]),COUNT(SELECT(Product[Useremail],USEREMAIL()=[_THISROW].[Useremail]))
Thanks @Rafael_ANEIC-PY. The expression does not seem to work. It is still reading from the last row of the โProductโ table.
Well, yeah, you said you wanted the โlatestโ, and spreadsheets get new entries as new rows, so whatโs at the bottom is the newest, and what is at the top is the oldest.
If you want the oldest one you can use this expression:
INDEX(SELECT(Product[GTIN],USEREMAIL()=[_THISROW].[Useremail]),1)
Hi, what I need to show the latest GTIN which is accessed by the useremail.
For example, I am login with useremail edmund@gmail.com, the GTIN should be 9310488341115. I tried the formula you provided me, when I am login with useremail edmund@gmail.com, it is not giving me the correct GTIN. It gives the GTIN 9556108261009 which was by mary@gmail.com not by edmund@gmail.com.
Can you assist me with the correct expression to show the correct GTIN?
Thanks for the reference link. I have tried many times and I still couldnt get what I want to work. I have tried the following but it is still reading from the last row of the table instead of reading the latest row based on the useremail login.
Did not help that mary@.com has the same GTIN for the first and last entries on that screenshot lol
And your original post does say
Hi @lala_land
I havent followed this closely but maybe you need to add in a VC to find your user and then find the users last entry.
Hmmโฆ what do you mean by VC to find your user? I donโt quite understand. Can you elaborate more ?
In what way doesnโt it work? No result? Result for a different user? Not the latest GTIN for the current user?
For testing, you need to login to the app as the test user. It may not be sufficient to use Preview As in the app emulator of the app editor.
It does not work as in it is not the latest GTIN for the current user.
For example, I login as edmund@gmail.com, it will still get the GTIN โ9556108261009โ instead of โ9310488341115โ which should be the case if it works.
Yes, I have been trying Preview as in the app simulator. Maybe I will try on the device instead. Thanks for the advice.
Thanks Steve. I have tried to login in with different email address using the AppSheet application on my device. And it works. From the app simulator, it is not sufficient to use the Preview As like what you have mentioned.
User | Count |
---|---|
39 | |
35 | |
29 | |
23 | |
18 |