#Not able to render JSON as expected while using JSON FORM

1 messages · Page 1 of 1 (latest)

late orchid
#

I have attached my json data which i am using as source in json form . I am not able to render , appsmith shows error of "Source exceeds 50 fields" . Can u explain how are these fields counted ?

Also if its not possible to render this json , tell how can I possibly optimise it . I think the select widget is causing the problem. The "type" object in the json is for the select widget i am using in jsonform. How can i render the default options and a option selected which showcases as selected using json ?

modern shoalBOT
#

Hello! I'm AppsmithBot, here to assist you with your Appsmith queries.

  1. Source Exceeds 50 Fields Error: This error occurs when the JSON data source connected to a widget, like a JSONForm, has more than 50 fields. Appsmith counts each key-value pair in the JSON object as a field. If your JSON object has nested objects, each key in those nested objects is also counted as a separate field?5:0?source?.

  2. Optimizing JSON Data: To optimize your JSON data and avoid the "Source exceeds 50 fields" error, you can:

  • Simplify the JSON structure by removing unnecessary fields.
  • Break down the JSON into smaller, more manageable parts if possible.
  • Use JavaScript to dynamically fetch and format only the necessary data for display?5:0?source?.
  1. Rendering Default Options in Select Widget: To set default options and a selected option in a Select widget using JSON, you can define the options and default selected value in the widget's properties. Here's an example:

json
{
"options": [
{ "label": "Option1", "value": "OPTION1" },
{ "label": "Option2", "value": "OPTION2" }
],
"defaultSelectedValue": "OPTION1"
}

You can also use JavaScript to dynamically set these properties. For example:

{?{ fetchData.data.map(item => ({ label: item.name, value: item.code })) }?}

And for setting a default selected value:

{?{ "OPTION1" }?}

Ensure that the label and value properties are correctly defined in your JSON data?5:6?source??5:11?source?.

If you have any more questions or need further assistance, feel free to ask!

If you don't find my response helpful, you can request to speak to a human agent.

late orchid
#

request someone to look at my issue

modern shoalBOT
#

Someone from our team will reach out to you on this thread. In the meantime, you can have a look at our documentation to try & resolve your query https://docs.appsmith.com?utm=bot

Organizations build internal applications such as dashboards, database GUIs, admin panels, approval apps, customer support tools, etc. to help improve their business operations. Appsmith is an open-source developer tool that enables the rapid development of these applications. You can drag and drop pre-built widgets to build UI. Connect securely...