Tip: Include a user's email address in reports

Private apps by default don't include the signed-in user's email address in reports. You can include this information using a simple formula. This tip also explains how to include information on the tags associated with a user.

Private apps require users to sign in before they gain access to your app. That’s great for internal line-of-business apps with potentially sensitive information and calculations.

However, what about reports sent from these apps? They are sent by specific, signed-in users, and yet that information is not included by default in reports. That means that you can’t determine who sent the report without doing extra work.

Luckily, getting this information included is pretty simple. Add a new field to your report and use this formula:

App.UserEmailAddress

Be sure to press the abc button in the inspector on the left-hand side of Calcapp Creator to make the field a text field. That’s enough to add a new field containing the user’s email address to reports, but you probably also want to make it invisible to your app users by toggling the switch next to the Visible property, again in the inspector. (All fields are included in reports, including hidden fields.)

When you add new users, you can optionally use tags to, say, tell contractors apart from employees and adapt your app accordingly (using properties such as Visible, to hide certain elements from some users, and NextPanelAvailable, to make certain panels inaccessible to certain users). The USERHASTAG function is used to determine if the signed-in user is associated with a certain tag.

You can add new hidden fields that convey these tags. You could, for instance, add a new switch field which reads TRUE if the user is an employee. You would use a formula like the following to accomplish this, provided that your tag is named Employee:

USERHASTAG("Employee")

You could also add a hidden text field, plainly spelling out the role of the signed-in user. If you have the two tags Employee and Contractor, use this formula:

IF(USERHASTAG("Employee"), "Employee", IF(USERHASTAG("Contractor"), "Contractor"))

Do you want to share a tip with other Calcapp users through this blog? [Let us know!][contact-us]

« Improved email deliverability Bug report: No more blurry images »