Post

2 followers Follow
0
Avatar

eMail Calculation for multiple item Relationship field

Hi,

I am trying to pull the email address from a specific user listed in a Relationship field with multiple items. Here is the script I am using -

 

var source = @All of Email Address;
source[0];
var es = source.map(function (obj) { return obj.type === 'work'});
es.map(function (obj) {return obj.value}).join() || "abc"

 

But the return I am getting are two commas (,,); can anyone help point me in the right direction please?

 

Thanks

An Vo

Please sign in to leave a comment.

2 comments

0
Avatar

Hi An,

var es must be source.filter() not source.map(). 

var source = @All of Email Address;
var es = source.filter(function (obj) { return obj.type === 'work'});
es.map(function (obj) {return obj.value})[0] || "abc"

Rainer

Rainer Grabowski 0 votes