CRM

名前付きクエリAPIで、AIエージェントやアプリケーションによるデータアクセスを簡略化

※本記事は2025年10月13日に米国で公開された Named Query API Simplifies Data Access for Agents and Apps の抄訳です。本記事の正式言語は英語であり、その内容および解釈については英語が優先されます。 注意:この記事の内容は、Winter ’26リリースで提供される名前付きクエリAPI(ベータ版)の最新情報にもとづき改訂されています。 名前付きクエリAPIは、Salesforceが正式公開に向けて準備している新機能です。このAPIは、システム管理者や開発者がAIエージェントやアプリをSalesforce組織内のデータにアクセスさせたいときに、そのプロセスを簡略化するのに役立ちます。名前付きクエリAPIを利用すれば、AIエージェントのカスタムエージェントアクションの土台になるSOQLクエリを定義し、それを外部アプリケーションから利用可能なREST APIとして公開することができます。 このブログ記事では、名前付きクエリAPIを使ってシンプルなデータアクセスを実現する方法を詳しく見ていきます。名前付きクエリAPIを作成する方法から、APIカタログでの表示を確認する方法、REST APIとして呼び出す方法、名前付きクエリAPIのREST APIを記述したOpenAPIドキュメントをダウンロードする方法、名前付きクエリAPIからエージェントアクションを作成する方法、作成したアクションをAIエージェントに組み込む方法まで、順を追って説明します。 現在のAIエージェントやアプリのデータアクセスの仕組み 現在、AIエージェントやアプリをSalesforce組織内のデータにアクセスさせるには、いくつかの方法があります。 AIエージェントの場合は、次のとおりです。 AIエージェントにアクセスさせたいデータを返す「レコードを取得」要素を含んだフローを作成し、このフローからカスタムエージェントアクションを作成する もしくは、AIエージェントにアクセスさせたいデータを返すSOQLクエリを含んだApexクラスを作成し、このクラスを呼び出し可能なメソッドとして公開したうえで、このメソッドからカスタムエージェントアクションを作成する こうして作成したカスタムエージェントアクションを、AIエージェントに実行させる 以上のようなやり方でAIエージェントをデータにアクセスさせることは可能ですが、フローやApexクラスを作成する手間がかかります。名前付きクエリを利用すれば、話はもっとシンプルになります。 アプリケーションの場合は、次のとおりです。 REST APIの/queryを利用して、必要なデータを返すSOQLクエリをSalesforce組織に送信する(ただしこの方法では、SOQLの知識が必要) もしくは、sObjects REST APIを利用し、レコードIDを通じて目的のレコードを取得する(ただしこの方法では、フィルタリング条件に合致するレコードセットを取得することはできない) 名前付きクエリAPIを利用すれば、RESTのセマンティクスを使って必要なデータをアプリケーションに引き渡す専用のREST APIを公開できます。 名前付きクエリAPIを作成、管理する まず、AIエージェントやアプリケーションにアクセスさせたいデータを公開する名前付きクエリAPIを作成します。名前付きクエリAPIの作成は[設定(Setup)]で行います。ツリーの[インテグレーション(Integrations)]で[名前付きクエリAPI(Named Query API)]を選択すると、名前付きクエリAPIのリストが表示されます。 [新規の名前付きクエリAPI(New Named Query API)]ボタンをクリックすると、名前付きクエリAPIの新規作成画面が開きます。 クエリのフィルタリング条件を定義したい場合は、WHERE句にパラメーターを指定します。上の例のように、パラメーター名の前にはコロンを付けてください。これらの入力パラメーターは、呼び出し元のAIエージェントやアプリケーションから名前付きクエリAPIへと引き渡されます。 ベータ版の名前付きクエリAPIでは、WHERE句とLIMIT句で入力パラメーターがサポートされています。 名前付きクエリAPIをVisual Studio Code内で作成する コーディングでの実装を好む場合は、Visual Studio Code内で名前付きクエリAPIを作成し、そのメタデータをSalesforce組織にデプロイすることも可能です。 たとえば、以下のGetAccountDetails.apiNamedQuery-meta.xmlファイルは、名前付きクエリAPIを表すメタデータを定義しています。このメタデータをSalesforce組織にデプロイすれば、名前付きクエリAPIが作成され、[設定(Setup)]で管理できるようになります。 Name of this account […]

名前付きクエリAPIで、AIエージェントやアプリケーションによるデータアクセスを簡略化 Read More »

From AI Researcher to AI Product Leader: A Salesforce Powered Career Pivot

Aabhas Sharma’s career began in the world of advanced AI research at IBM. In this role at IBM, he helped transform cutting-edge AI ideas into real prototypes, working on diverse applications from AI-powered educational tools to sophisticated machine learning security systems, innovations to IBM’s customers. Initially, his professional drive centered on expanding his portfolio with

From AI Researcher to AI Product Leader: A Salesforce Powered Career Pivot Read More »

Improve Data Integration with the B2C Intelligence Connector

The B2C Commerce Intelligence Connector from Agentforce Commerce is now generally available. This feature gives customers a more robust mechanism for ingesting and managing comprehensive commerce data.  Users can now extract shopper journey data (such as orders, products, promotions, and onsite search). Ultimately, this new feature helps you connect the dots between your ecommerce site

Improve Data Integration with the B2C Intelligence Connector Read More »

Who are Partnerblazers?

The strength of the Salesforce partner ecosystem lies in our Partnerblazers – an innovative, supportive, and active community of partners driven by a shared commitment to customer success. As part of the Trailblazer community, this powerful collective brings together consultants, tech partners, and strategic tech partners, all dedicated to making a real impact. Whether you’re

Who are Partnerblazers? Read More »

Reading the Room – Can AI Agents Really Master Empathy?

Key Takeaways Traditional personalization is pattern-matching, not true understanding or recognition of customer behavior. Emotive AI can detect frustration, urgency, or satisfaction in customer interactions, and respond accordingly. Development of emotive AI must include linguists, conversation designers, and social scientists as well as developers. This summary was created with AI and reviewed by an editor.

Reading the Room – Can AI Agents Really Master Empathy? Read More »

How Vince bridges the gap between online discovery and in-store purchasing

Quiet sophistication. Understated luxury. Vince is a fashion retailer known for its premium quality and effortless style. The brand’s ecommerce site and its brick and mortar shops exude intentional, curated elegance. But Vince needed a way to bridge the two experiences with the same ease and sophistication. That’s why Vince implemented Shop the Store, a

How Vince bridges the gap between online discovery and in-store purchasing Read More »