Is there a table component in actions-on-google?

2019-08-19 10:44发布

问题:

Is it possible to implement a table for displaying information using actions-on-google and dialogflow?

AFAIK there is insufficient markdown in simple response to output a table, and my best bet is to write the column name in-line on each text row.

Thanks.

回答1:

In short - no.

Most visual response formats that Actions provide are meant to be visual counterparts of the voice component, sometimes supplementing it in ways that are distinctly visual. Most tables would be too large to be part of a "conversation".

Depending on your needs, linking to a website with the tabular information is probably your best bet, or providing a small subset of the results as part of a card, as Options, or as suggestion chips.



回答2:

There's now a table card response object! https://developers.google.com/actions/assistant/responses#table_card

Awesome!



回答3:

As Prisoner said, the platform isn't really designed for that. However, two semi-workarounds could be using a list selector, if that will work for your use case, or generating an image of a table to use for a basic card. However both these solutions won't result in Google Assistant effectively communicating any information in the table by voice.