Legacy Knowledge Base
Published Jun. 30, 2025

Data Provider fails to provide data for a text field

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

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

Environment

  • Liferay DXP 7.4

Resolution

  • Currently the returned result is in a JSONArray, due to the usage of the indefinite path: $..name.common 
  • That is the reason why the text field cannot be autofilled with the value, since the return is not a single value.
  • If you will use a path that is a definite path instead of an indefinite path, it should return a single value.
  • JsonPath library's documentation
     

    A path is indefinite if it contains:

    • .. - a deep scan operator
    • ?(<expression>) - an expression
    • [<number>, <number> (, <number>)] - multiple array indexes

    Indefinite paths always returns a list (as represented by current JsonProvider).

     
  • Recommended solution: changing the path to $.[0].name.common would change it to a definite path and the expectation would be that a single value is returned.
  • Note: this is a proof of concept and ultimately it is up to you to decide on how to configure a Data Provider for your particular use-case.
  • Additionally, you will also need to set View permission for the Guest user on the Data provider, in order to get the text field autofilled for the guests.
Did this article resolve your issue ?

Legacy Knowledge Base