{"templateId":"GuidePage","sharedDataIds":{"sidebar":"sidebar-miniapps/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Dynamic Data Sources (RPC)","description":"Developer API, partner integration, MCP, SDK, and customer help center.","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"dynamic-data-sources-rpc","__idx":0},"children":["Dynamic Data Sources (RPC)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Sources provide dynamic dropdown options in action forms. Define them at the miniapp root level under ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["source"]},", and reference them in parameters via ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["x-source"]},"."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"// MiniApp root level\nsource: {\n  // Each key must start with \"rpc_\"\n  rpc_channels_list: {\n    url: 'https://slack.com/api/conversations.list?limit=1000&types=public_channel,private_channel',\n    method: 'GET',\n    headers: {\n      Authorization: 'Bearer [[accessToken]]',\n    },\n    dataPath: 'channels',         // JSONPath to the array in the response\n    valueField: 'id',             // Field to use as the option value\n    labelField: 'name',           // Field to use as the option label\n  },\n\n  rpc_users_list: {\n    url: 'https://slack.com/api/users.list?limit=1000',\n    method: 'GET',\n    headers: {\n      Authorization: 'Bearer [[accessToken]]',\n    },\n    dataPath: 'members',\n    valueField: 'id',\n    labelField: 'profile.real_name',  // Supports nested paths\n  },\n},\n\n// Then reference from action parameters:\nactions: [{\n  parameters: {\n    properties: {\n      channel: {\n        type: 'string',\n        title: 'Channel',\n        'x-source': 'rpc_channels_list',  // ← Matches key in source\n        'x-fallback': 'input',\n      },\n    },\n  },\n}]\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Source definition fields:"]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Field"},"children":["Field"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Required"},"children":["Required"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["url"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["✅"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["API endpoint URL (supports ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["[[cred]]"]}," placeholders)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["method"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["✅"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["HTTP method (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST"]},")"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["headers"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["object"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["—"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Request headers"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["queryParams"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["object"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["—"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Additional query parameters"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["dataPath"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["✅"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Path to the array in the API response"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["valueField"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["✅"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Field name to use as the option value"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["labelField"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["✅"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Field name to use as the option label"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["valueFields"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["object"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["—"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Alternative value fields per ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sourceRef"]}," context"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["How it works at runtime:"]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["User opens the action form"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Frontend calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["miniAppsActionSources"]}," GraphQL query with the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sourceKey"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Backend fetches the source URL with the user's credentials injected"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Response array is extracted from ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["dataPath"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Each item is mapped to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{ value, label }"]}," using ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["valueField"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["labelField"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Dropdown renders with the options"]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]}]},"headings":[{"value":"Dynamic Data Sources (RPC)","id":"dynamic-data-sources-rpc","depth":1}],"frontmatter":{"title":"Dynamic data sources","titleTranslationKey":"sidebar.miniapps.dynamicDataSources","audience":"developer","status":"published","locales":["en"],"template":"GuidePage","seo":{"title":"Dynamic Data Sources (RPC)"}},"lastModified":"2026-06-23T12:06:12.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/miniapps/guides/dynamic-data-sources","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}