How to get the emails from related app email field?

I want to get the related emails from related app, see image below

JSON.Stringify is not working, any sample script for this?

Cheers,

if you really just want to get the string:

let string;
try {
 string = JSON.stringify(@All of Email);
} catch(e) {
 console.error('Error stringifying:', e);
}

string

will give you a result like:

[{“type”:”WORK”,”value”:”alpha@jmc.tools“},{“type”:”WORK”,”value”:”bravo@jmc.tools“}]

this post may also help: [✅ Solution] Email fields. How to call in a calculation? - #4 by Tim
Or you could:

const or = jsonata('value[]').evaluate(@All of Email).join('\n');
or

which will give you:

alpha@jmc.tools
bravo@jmc.tools

so it kinda depends what you actually want as your final thing.

3 Likes