Workspace Contact Cards - Contact Fields

Jorogumo4
Kilo Guru

Hey all, I'm having issues customizing the contact fields on a contact card... Any help would be appreciated.

Jorogumo4_0-1770916168908.png Jorogumo4_1-1770916251540.png

 

Here we can see that by default, the contact cards use this item:property type information, but we cannot data pill anything here or even use client script values? I'm not sure how I am supposed to have dynamic information here, if it's even possible.

 

I can just instead datapill the configuration side of it, but even when it successfully returns a value, nothing is output on the contact card. Will I just need to possible run some type of client script against the configuration of this contact card? It's stored within a repeater... 

 

What's the best approach here, I'm wanting it to dynamically contain each contact on this form's email, and phone number. 

 

My repeater is set to look at record>form>recordMembers

1 ACCEPTED SOLUTION

Further refined to:

function evaluateProperty({api,helpers}) {
    var email = api.item.value.email;
    if (!email) return [];
    
    return [
        {
            label: 'Email',
            value: email,
            clickable: true,
            id: 'email-link'
        }
    ];
}

View solution in original post

2 REPLIES 2

Jorogumo4
Kilo Guru

I resolved this by assuming the contact card for whatever reason wants a json return.

 

So, I built this script and it seems to work well.

function evaluateProperty({api,helpers}) {
    var userEmail = api.item.value.email;
    var contact = '[{' + 
    '"label":"Email",' +
    '"value":"' + userEmail + '",' +
    '"clickable":true,' + 
    '"id":"email-link"' +
    '}]';
    
    return contact;
}

If there's a better way about this, could someone advise? Until then I guess I will be operating this way.

Further refined to:

function evaluateProperty({api,helpers}) {
    var email = api.item.value.email;
    if (!email) return [];
    
    return [
        {
            label: 'Email',
            value: email,
            clickable: true,
            id: 'email-link'
        }
    ];
}