Chat.Guest.customFields May Not be Populating Correctly

I was following the article in the Resource Center and tips in the Developer Forum to examine the values (Get Participant Data) in a Chat Flow that were entered in the form fields in the Developer Tool for Web Chat (https://developer.mypurecloud.com/developer-tools/#/webchat) and I found something peculiar with the key/value pairs for Chat.Guest.customFields collection.

Specifically, when I iterated through the collection, all of the Values were empty. However, the Keys held some of the values that were entered.

Here is the Architect loop:
image
The Get Participant Data expression is: Chat.Guest.customFields[State.i].key
and then I append the data to a string with the Update Data: Append(Flow.collItems, ToString(State.i), "--", Flow.chatAtt, "\n") so that I can view the contents in a list.

The output looks like:
1--kafa@de.cn
2--Chrome
3--https://developer.mypurecloud.com/gettingstarted/developer-tools-explorer.html
4--Emily
5--395 Givgaj Trail
6--(508) 461-1797
7--web
8--
9--44001
10--Sales
11--Dojebor
12--DF Mainstream Counselling
13--Emily
14--
15--
16--
17--Garrett
18--
19--https://developer.mypurecloud.com/developer-tools/#/webchat
20--OK
21--Developer Tools
22--Cat

For the form completed:

Why is the data entered in the form being stored in the Keys and not the Values?
PS. I do know that we can get the values using the context object/collection.

Dan_Fontaine, it looks like you've got a bit of confusion here. When you begin a chat like this, the custom data you seek is already in builtin flow variables. You don't need a GetParticipantData action at all. You're already using "Chat.Guest.customFields[State.i].key" obviously, and its matching value is available natively at "Chat.Guest.customFields[State.i].value". These keys/values are not automatically pushed directly to Participant Data (although some flows do this for other purposes). What you appear to need here is to just ditch your Get Participant Data step and instead use "Chat.Guest.customFields[State.i].value" directly to print the value.

Obviously if I've mis-diagnosed your problem or mis-understood your situtation let me know and I can look more. But I think this is what you need.

Dan

Yes, based on documentation, .value should have that data. However, as I said, the Value elements are empty. Just to make sure, I did make the change in Architect back to .value
image

And here is the result:
1--
2--
3--
4--
5--
6--
7--
8--
9--
10--
11--
12--
13--
14--
15--
16--
17--
18--
19--
20--
21--
22--
All empty - unless I am missing something. Give it a try. Again, I am using the Web Chat Developer Tool for testing.

Very curious. I just set up a chat from the developer tools and it worked fine for me. Is your flow definition ID "f391eed8-542f-4fe2-b549-7e058011b94e"? What version were you running that gave you the list of all empty values?

Yes, that is my flow ID.

Both 1.1 and 2.0 have the same behavior. Version 2.0 has 23 items in the collection and Version 1.1 has 16. Can you share/screenshot your Architect flow (or at least the loop)?

When I asked for version number, I meant the flow version number. I think it should be somewhere in the 70's if I'm looking at the right thing.

As far as my test flow that I launched from the developer tools, it looks like this:
image

where the Update Data within the loop is Append(Flow.looseString, ToString(State.i), "--", Chat.Guest.customFields[State.i].key, "=", Chat.Guest.customFields[State.i].value, "\n")

Okay, it's official, I am an idiot :slight_smile:

I just realized that I was misreading the Get Participant Action input. For some reason, I thought it was asking me to enter what Participant Data value I wanted to assign to the variable. What it is asking for is the freaking Name of the Attribute that you would like to get the value for and then assign that value to the variable.

So, of course, when you reference .key (the Name of the Attribute) in that input field a value is returned. - Duh.

Request to delete this topic.. OMG.

No worries, it happens to everybody! Glad you're fixed up now.

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