Hi all,
I’ve looked at several sample apps on group messaging etc. but haven’t quite figured out how to create a “group” from a broader user base. Here are some more details:
-
Broader user base is not public/searchable for privacy reasons. For example, say 100 users have the app. I’ve asked a friend “John Smith” to download the app . So I need to identify that John Smith is a registered user and can accept a request to join my group if they are a registered user.
-
I want to be able to then have a group chat within the app for only invited users.
I currently have a USERS table and a CONTACTS table. SHould I create a column in the CONTACTS table that is something like “Contact_is_user” (Y/N) based on matching the email for the invited member (user #2) from user #1? Example: User #1 “Adds a Contact” for John Smith and uses the email they know for John Smith (jsmith@example.com). A rule then looks up that jsmith@example.com is a user?
If so, how/where would I write the expression to do this?
Any better ways?
TY!
I understand that you have two tables: Contacts, containing a broader user base, and Users, containing just a subset of selected contacts. What you need is to see whether a particular email exists in the selected subset that is table Users.
For this you can use the expression: IN(USEREMAIL(), Users[userID]), where “userID” is the Key column in table Users, that should contain the emails of the users.
Instead of having two tables, you can add the column “Contact_is_user” to Contacts table as you said, and in this case instead of having a separate Users table, you can create a slice out of Contacts table with the following row filter condition: [Contact_is_user], providing this column is of type Yes/No. You can name this slice Users and apply the same expression above to check whether the user’s email is part of this slice.
1 Like
Thanks for the reply @Joseph_Seddik . Where would the “IN” expression go in scenario number 1?
Also, just to be clear I’m not looking to see if the current user’s email address is in the user list. I’m looking to see if a user enters a “new contact” into a form of some kind, whether the email they enter…of a contact of theirs…is an active user or not.
You want to see whether a user is active or not, then you should have a list of active users to check against. This list of active users is in a table, so you check whether this email is in a table. Hence, similarly, you should use this expression, anywhere needed:
IN([new contact], Users[userID])
This expression returns TRUE or FALSE. Please read this: IN() | AppSheet Help Center
2 Likes
Thanks again @Joseph_Seddik . I really appreciate your help. Unfortunately, I put this expression in the “contact_is_user” definition and it always returns “no”. So when I enter a “new contact” it always says they aren’t active. using that expression.
Do I need to alter the expression to account for the current user? That is, a current user is entering a list of contacts (who need to first be users). I’m trying to flag that the contact in some cases may not yet have registered in the app. I’ve got a list of sample emails in the “Users” table and when I enter the new contact (that would go to the “Contacts” table), it always returns “No” even though I’m entering email addresses that ARE in the user list. Could it be that it is defaulting to “no” because of table or currentuser issues? I don’t know…just ideating here 
This expression assumes your “contact_email” column will hold one email not a list of emails.
What is the type of your “contact_email” column? How does a user enter emails in this field?
1 Like
I’m sorry! I made a minor error in my column name above (ugh!). You’re solution was perfect! Thank you again @Joseph_Seddik
2 Likes
See above. The solution worked as suggested by @Joseph_Seddik .
Thank you so much!
2 Likes