Can I manually set USERMAIL() option?

Hi,

I have created an app, and I would like to be able to manually specify which user is to be used at the start of the app.

I use the USEREMAIL() feature a lot in the App, and I would like to create a menu on startup (for one user) from which the account information of another user can be selected.

For example, the user's real email address would be john.doe@company.com and this user would still like to appear in the app with another user's account, which would be  jane@company.com

In short, I'd like to manually set the USEREMAIL() property after user login via the selection menu to mean something else

So with this start menu I would like to create an opportunity for one user to appear in the app with another person's account, is this possible?

Thanks in advance for your help 🙏

Jani

0 6 223
6 REPLIES 6


@Jani wrote:

So with this start menu I would like to create an opportunity for one user to appear in the app with another person's account, is this possible?


No, you cannot manually assign the USEREMAIL() function.

You could build your own feature to do what you are asking,  For example, there is a User Settings list.  You can surface that with some variable that is set by the user with the email desired and then reference that User Setting throughout the app.

For more details, get started with this article:

User Settings: The Essentials

FYI, this sounds like a huge breach of security.  It may be helpful to you if you could explain why you want to have this feature.  Maybe there is another feature or idea to support your need.

I agree with @WillowMobileSys , developing to impersonating a user account generally is very frowned upon.  If it is for a coporate solutions, this would be redflagged and looked at with strong suspicion of the developers intent.

Thanks for the quick reply @WillowMobileSys and @WillVerkaik !

I know this sounds like an unusual request, and also a breach of security against other people's accounts.

The purpose is to make it easier and faster to use App for one user. This one user must have access to data created by all other users.

I use security filter features in Apps, and they prevent App sync from working quickly (cannot use Delta Sync, Server caching), and every time this one user makes changes to the data, the sync takes a really long time, because she always has the data of all users in her view.

Using slices doesn't really work in this situation, so I'm trying to build the same type of view that exists when developing an app "Preview app as". This would greatly speed up the operations of this one user when not all data is constantly visible.

I'll try to look at the instructions in "User Settings: The Essentials" if that would help me, Thanks for the tip!


@Jani wrote:

The purpose is to make it easier and faster to use App for one user. This one user must have access to data created by all other users.

I use security filter features in Apps, and they prevent App sync from working quickly


I see.  You are simply trying to find ways for this user to see all entries by all users in a faster way.

A common mistake made is to think that since this user MIGHT need access to any data at any time, then ALL data must always be downloaded for this user.  But, in many cases, the reality is that this user may only need to see the last 2 weeks or last 30 days for all users.  Only very rarely do they need to go back further.

In these types of cases, I would recommend either to:

1)  Apply to a standard range of historical data to the Security Filter to be downloaded - e.g. always only the last 30 days - IF the user never needs to see data beyond this threshold.

...OR...

2) Create User Settings for a Date Range of loaded data - a Start Date and an End Date.  This Date Range always defaults to the last X number of days - e.g. 30 days and is applied to the Security Filters of the working data.  When the user needs to  look at older data, they then have a choice to simply adjust the Start Date to further in the past to the present OR look at a narrower window in the past by adjusting both Start and End Dates.

*********************

As second course of action, you should analyze and improve the Sync times. 

The fact that you are looking for ways to download data faster would suggest that your Sync times are unbearably slow at the moment.  There is a Performance Profile tool in your app under the "Manage" section.  If you open that and drill into the Sync Time performance, you will likely find MOST of the Sync time is being spent on Virtual Column (VC) calculations.  this tool also highlights for you the top 10 problematic virtual columns.

The good news is that most virtual column usage can be re-implemented to eliminate its impact on Syncs.  Doing this for each qualifying VC will drastically reduce the Sync time.

The bad news is that this re-implementation will take time and effort.

 

Thanks @WillowMobileSys about quick answer, again 👍

Splitting the data into smaller time periods doesn't work in my case, as I have formulas that calculate things cumulatively. Really good tip though.

If I split the data into smaller periods, I would have to make really big changes to the app, and then it might be better to start from scratch and build a completely new app.

However, I was able to solve the issue when I created a new table (SwitchUser1), in which I only give this one user the opportunity to make changes. User can select the email of another user's account for one row of the table.

After that, I made a change to the Security Filter formula to create sliced data for this one user. Every other user uses another Security Filter formula and then sees only own data.

Security Filter formula looks like this: IF(USEREMAIL() = "jane.doe@company.com", [Employee] = CONCATENATE(SwitchUser1[SwitchUser]), IN([Employee], SELECT(EmployeeToReps1[EmployeeID], [EmployeeRepEmail] = USEREMAIL())))

[Employee] = defines visible data and account / EmployeeToReps1 = Table where the e-mail addresses of other users are specified /

This was the right solution for me this time , and thanks again to everyone who gave tips 🙏

Understood.  

Something I did that worked for me to achieve something similar and it relates to the comment from @WillowMobileSys  on performance do to record volumes.

I am extracting from large Bigquery data sets and need to filter dynamically of records currently at 5mil.

Using Dashboard, I have view with a selectable picklist for categories that segment the data into amounts less than 100K records ( this appears to the be the upward limit of Appsheet as I understand ).  

This picklist stores the choice into a data store so not to be maintained in memory ( in your case it can be an email user account if that is the search filter ).   The second view has the security filter based on the value stored.  When updated, it refreshes and filters on the selection. 

Someone in the community may look at what I have done and recommend an alternative solution that is more effective.  I would be please to hear if there is. 

Top Labels in this Space