legacy-knowledge-base
公開されました Jun. 30, 2025

データプロバイダがテキストフィールドのデータを提供できない

written-by

Balázs Létai

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

問題

  • DDMRestDataProvider と Autofill Rule を使用してテキスト・フィールドに入力しようとしています。 私は次の記事に触発された:

    https://learn.liferay.com/w/dxp/process-automation/forms/form-rules/using-the-autofill-rule

  • DDMRestDataProviderを次のように設定した:

    ゲストの読み取りアクセス許可

    URL:https://restcountries.com/v3.1/name/deutschland

    出力:

    パス: $..name.common

    タイプテキストフィールド

    ラベル"名前共通"

環境

  • Liferay DXP 7.4

解像度

  • 現在、返される結果はJSONArrayになっている。これは、 不定 パスの使用によるものである: $..name.common .
  • これが、テキスト・フィールドに値を自動入力できない理由である。
  • 不定 パスではなく、 パスを使用する場合、単一の値を返すはずである。
  • JsonPathライブラリのドキュメント

    パスが 不定

    • ... - ディープ・スキャン・オペレーター
    • (<expression>) - 式
    • [<number>, <number> (, <number>)] - 複数の配列インデックス

    不定形の パスは、常に(現在の JsonProvider で表される)リストを返します。

  • : パスを $.[0].name.common に変更すると、 確定 パスに変更され、単一の値が返されることが期待される。
  • 注: これは概念実証であり、最終的には、特定のユースケースに対してデータ・プロバイダーをどのように構成するかは、あなた次第である。
  • さらに、、ゲスト用のテキストフィールドを自動入力するために、データプロバイダのゲストユーザーに表示権限を設定する必要があります。
did-this-article-resolve-your-issue

legacy-knowledge-base