Dialogflow CX - using sys.person gives wierd output

437 views Asked by At

https://i.stack.imgur.com/k1bZD.png

I am using sys.person to capture the person's name. Is there any way for just 'john' and not the entire {"name": "john"} to show instead? I want to avoid sys.given-name and sys.last-name since dialogflow says they are deprecated.

2

There are 2 answers

0
Leo On

From your screenshot, it looks like your parameter is an isList parameter.

I have checked today the behavior of static responses when referencing isList parameters and it seems that we can now display the list of values for a certain parameter without the array index in the responses using the format: $session.params.parameter-id.

In your case, it would be: $session.params.name.

In addition, if you want to reference a specific array index in an isList parameter, you can use the format $session.params.parameter-id[i]. In your case, it would be $session.params.name[0]

or if you want to get the original value you can reference it as $session.params.name[0].original

0
João Miguel Brandão On

Do you have your entity configured as a list? If it is a list, you probably have to output the parameter like $session.params.name[0].name.

If it's not a list, $session.params.name.name would work, but in that case I suggest you change the entity name to person, as it would be more readable to see $session.params.person.name