How can obtain only one field of Chat.Guest.customFields

chat.guest.customField bring this information

[context. firstName, valor1]
[context. lastName, valor2]
[context. phoneType, valor3]
..
We need save only the "valor3", is it possible?

I'm not sure what you mean. Where/how are you trying to access the fields? What do you mean by "save" it?

Hi Tim
I need recover only one field (in this case I need the email address) of the customer field, for save it on a variable to use for assemble a URL for open the contact sheet on the script.
The url for example https://192.168.2.34/view.php?id=ateran@gmail.com

If you're trying to access participant attributes (i.e. the data set when creating the chat), you can add a script variable of the same name and set it as an input property to access the participant attribute.

Hi Gladys,

I was trying to achieve something similar. I was able to access my email field by using Chat.Guest.customFields[0].value. Just change position 0 to the position you require.

Hope that helps.
Bart

Within architect, can also always use Get Participant Data action to retrieve the value of a custom field. That's what works across all media types.

The syntax Chat.Guest.customFields[0].value is specific to chat, but doesn't need to be used at all. Keep in mind that the position of the email field may change, so if you are leveraging the short hand notation, you would need to loop through the custom fields to find the right key first rather than guessing at the position. That's why I personally think it's easier to just use the Get Participant Data action.

1 Like

thanks Bart_O_Shea
I going to test with this manner.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.