Google Chat multiselect input doesn't see my own account

23 Views Asked by At

I am making a Google Chat bot with some forms placed in the dialog windows. I decided to use multiselect input and set a Workspace as a data source so I will have typings suggestions when filling the "user" input. A followed the documentation, and set the source as "USER". Currently this is how function looks like:

def create_selection_input(
        label: str,
        name: str,
        items: list[dict] = None,
        from_workspace: bool = False,
        min_items: int = 1,
        max_items: int = 1
):
    widget = {
        "selectionInput": {
            "type": SelectionTypes.MULTI_SELECT,
            "label": label,
            "name": name,
            "multiSelectMaxSelectedItems": max_items,
            "multiSelectMinQueryLength": min_items,
        }
    }
    if not from_workspace:
        widget["selectionInput"]["items"] = items
    else:
        widget["selectionInput"]["platformDataSource"] = {"commonDataSource": "USER"}
    return widget

And it's actually working, but the strange thing here is:

  • I don't see my own account when I type my name/email
  • It ignores any custom values, which isn't in the "data source". So in that case the value won't be set to the API which causes the error.

How to deal with it? Is there a way to add myself to that list or a way to make it accept custom values?

0

There are 0 best solutions below