Expand my Community achievements bar.

Filter Wildcard for user's email address

Avatar

Level 10

Hello,

 

As I tried around for a couple of hours now, this is my last chance...

 

I do have a custom text field, which is filled from an external data source with an email address.

Now I want to set up a filter in a project report to only show projects, where the value of the custom field is equal to the email address of the the current user.

 

Unfortunately the $$USER Wildcard does not provide the current users email, nor the username.

As the email addresses have the common format firstname.lastname@domain.com, I had the idea to do something like this:

 

DE:customFieldName=$$USER.firstName
DE:customFieldName_Mod=cicontains
AND:1:DE:customFieldName=$$USER.lastName
AND:1:DE:customFieldName_Mod=cicontains


 But this approach does not work completely, as there are users with umlauts in their names and others with two or more first names, of which only one is included in the email address.

 

Changing the custom field to a TypeAhead-field is not possible, because not for all entered email addresses there is a user in Workfront.

 

I did not find anything helpful using the community search, although I cannot imagine, that nobody missed such a wildcard before...

 

 

I really hope, that someone has any idea leading me into the right direction!

 

Thanks in advance.

 

Regards

Lars

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

2 Replies

Avatar

Community Advisor

Darn this is frustrating. You are correct that there is no wildcard option for email address. Is there any other possible option for you to reference instead? Or to bring in another column for user ID next to the email column and have the wildcard filter search for $$USER.ID instead?

If this helped you, please mark correct to help others : )

Avatar

Community Advisor

 

This is voodoo @lgaertner but (having experimented while wondering) seems to work...

 

Workfront (nee AtTask, nee @task) was originally built upon an Oracle back end, but (likely to reduce licensing costs) moved to Postgres several years ago. Both, though, happen to use the same couple of special characters for wildcards under the hood:

 

% for an unlimited length wildcard search, and

_ for a single character wildcard search

 

With these special characters in hand, you can then do some basic pattern matching to find some interesting combinations, such as finding a particular users via their email address, as you're attempting. In my instance, I have MANY "Brian" users, for example, but to find the ONE among them whom I'm looking for (namely, Brian.Tompkins-spm@esuite.ca), I can use the following search string in the Advanced search, which then returns what I'd expect, as shown below.

 

%brian%tom%@%ca

 

To make the API work in a similar fashion requires HTML encoding of the % signs (which are "special", and happen to equate to %25 when encoded), but having just now confirmed those facts, I'm pleased to confirm that the following ALSO works, and returns just my ONE expected "Brian" (results below):

 

https://atappstore.my.workfront.com/attask/api/v15.0/user/search?emailAddr=%25brian%25tom%25.ca%25&e...

 

And finally, while we're at it, this cilike mod also worked, too (same results):

 

https://atappstore.my.workfront.com/attask/api/v15.0/user/search?emailAddr=%25brian%25tom%25.ca%25&e...

 

I invite you to apply these tips to you situation, which I hope encourage you to continue travelling your preferred path.

 

Regards,

Doug

 

Doug_Den_Hoed__AtAppStore_0-1712161573600.png

 

{
data: [
{
ID: "575f555e00124c43bb5558acc712b4e8",
name: "Brian Tompkins",
objCode: "USER",
emailAddr: "Brian.Tompkins-spm@esuite.ca",
licenseType: null,
myInfo: null,
phoneNumber: null,
title: "VP Exploration",
workHoursPerDay: 8
}
]
}