How to find the board views for my app only?

I’m trying to find all the board views for my app from within my app.

For example, if multiple board views have been added for the same app, I want my app to be aware.

For a particular board, I can find all the board views using this GraphQL:

{
  boards(ids: [2768573330]) {
    name
    id
    type
    views {
      id
      name
      type
      __typename
      settings_str
      source_view_id
      view_specific_data_str
    }
  }
}

It produces:

{
  "data": {
    "boards": [
      {
        "name": "My Example Board ",
        "id": "2768573330",
        "type": "board",
        "views": [
          {
            "id": "138306178",
            "name": "Google Calendar Example",
            "type": "FeatureBoardView",
            "__typename": "BoardView",
            "settings_str": "{}",
            "source_view_id": null,
            "view_specific_data_str": "{}"
          },
          {
            "id": "184034674",
            "name": "Another Example",
            "type": "FeatureBoardView",
            "__typename": "BoardView",
            "settings_str": "{}",
            "source_view_id": null,
            "view_specific_data_str": "{}"
          },
          {
            "id": "146738409",
            "name": "Yet another Example",
            "type": "FeatureBoardView",
            "__typename": "BoardView",
            "settings_str": "{}",
            "source_view_id": null,
            "view_specific_data_str": "{}"
          }
        ]
      }
    ]
  },
  "account_id": 123445678
}

This returns all board views (from all apps).

  • Is there any way to identify which board view goes with which app?
  • I want to filter by just my app’s board views, not all of them

I haven’t really tried working with the board view settings but is there a chance you can set a unique value for the settings for your app which you can filter by?

1 Like

@kolaai That’s exactly where I was going next if I heard nothing back :wink:

1 Like

@kolaai

Yeah, storing things in settings is no good.

  1. There’s no way of hiding settings from the end user, so they will be visible
  2. Settings are user editable, so may change (and just look odd as well).
  3. You can only save settings that have been specified in the UI

Example, if the setting added in the UI is called text, you would only be able to store in that field, so saving this:

const payload = {
  appId: 'my.app',
  appPath: location.pathname,
  text: 'xxx'
}
monday.set("settings", payload),then(...)

…would actually save as:

{
  text: 'xxx'
}

Hmmm.

Hello there @dvdsmpsn,

What about getting the view ID via SDK (context) the first time the view loads and saving it so that then you can query for the views in a board and compare the IDs?

1 Like