Pulling data out of a relation field
Hi,
Can anybody tell me if it's possible to pull data out of a relationship field and group it?
I have a relationship field to my contact app but when I pull the data for multiple contacts it just lists what I want to pull.
Is it possible to group the data from contact A and after a brake line the data form contact B like so:
E-mail.: Jane@chilly.com
Tel: 123456789
E-mail.: Jhon@willy.com
Tel: 987654321
Kind regards,
Michael
-
The code works correctly only if all phone fields have the same number of phone numbers (e.g. all 1) and all email fields the same of email addresses (e.g all 1). If one field has 2 entries or is empty the code doesn't work. The following code should cover all cases:
var a = @All of Telefoon with nulls;
var b = @All of E-mail with nulls;
var list = [];
for(var i = 0; i < a.length; i++){
aCheck = a[i][0] != null ? a[i].map(function (obj) { return obj.value }).join() : "--";
bCheck = b[i][0] != null ? b[i].map(function (obj) { return obj.value }).join() : "--" ;
list.push("E-mail: " + bCheck + "\nTel: " +aCheck);
};
list.join("\n\n")Rainer
Please sign in to leave a comment.
Comments
6 comments