Legacy Knowledge Base
Published Sep. 10, 2025

Error Creating Web Content with Nested Fields via Headless API: 'Value Should Not Be Set for Transient Field'

Written By

Apsara Raheja

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

  • When attempting to create web content that includes nested fields using the Headless API, the user encounters a 400 Bad Request error. The response message states:
    "Value should not be set for transient field 'name"
  • Steps to reproduce:
    1. Create a structure having 1 nested field (2 text and 1 upload field) or 1 text field 
    2. Add a JPG document in the document and media section.
    3. Navigate to localhost:8080/o/api, request URL: (POST) http://localhost:8080/o/headless-delivery/v1.0/sites/20119/structured-contents
    4. Pass the below in the request body:
    {
      "contentFields": [
            {
              "contentFieldValue": {
                "data": "title before change"
              },
              "dataType": "string",
              "inputControl": "text",
              "label": "Title head",
              "name": "Text58075704",
              "nestedContentFields": [],
              "repeatable": false
            },
            {
              "contentFieldValue": {},
              "dataType": "",
              "label": "nested field",
              "name": "Fieldset02998378",
              "nestedContentFields": [
                {
                  "contentFieldValue": {
                    "data": "field 1 after change"
                  },
                  "dataType": "string",
                  "inputControl": "text",
                  "label": "feild q",
                  "name": "Text11418434",
                  "nestedContentFields": [],
                  "repeatable": false
                },
                {
                  "contentFieldValue": {
                    "document": {
                      "contentType": "Document",
                      "contentUrl": "/documents/d/guest/90mb",
                      "description": "Get customized package andman nikobar",
                      "encodingFormat": "image/jpeg",
                      "fileExtension": "jpg",
                      "id": 33155,
                      "sizeInBytes": 138780,
                      "title": "119000/-INR per person"
                    }
                  },
                  "dataType": "document",
                  "label": "Select photo",
                  "name": "DocumentLibrary78180319",
                  "nestedContentFields": [],
                  "repeatable": false
                },
                {
                  "contentFieldValue": {
                    "data": "fieldfield 2 after change"
                  },
                  "dataType": "string",
                  "inputControl": "text",
                  "label": "field 2",
                  "name": "Text72087547",
                  "nestedContentFields": [],
                  "repeatable": false
                }
              ],
              "repeatable": false
            }
          ],
          "contentStructureId": 33116,
          "title": "nested field structire contents after update"
        }

Environment

  • DXP 7.4
  • 2023.Q4 Quarterly Release

Resolution

  • Remove the "contentFieldValue": {} line for the fieldset field from the request body. For example:
    {
      "contentFields": [
        {
          "contentFieldValue": {
            "data": "title before change"
          },
          "dataType": "string",
          "inputControl": "text",
          "label": "Title head",
          "name": "Text58075704",
          "nestedContentFields": [],
          "repeatable": false
        },
        {
          "dataType": "",
          "label": "nested field",
          "name": "Fieldset02998378",
          "nestedContentFields": [
            {
              "contentFieldValue": {
                "data": "field 1 after change"
              },
              "dataType": "string",
              "inputControl": "text",
              "label": "feild q",
              "name": "Text11418434",
              "nestedContentFields": [],
              "repeatable": false
            },
            {
              "contentFieldValue": {
                "document": {
                  "contentType": "Document",
                  "contentUrl": "/documents/d/guest/90mb",
                  "description": "Get customized package andaman nicobar",
                  "encodingFormat": "image/jpeg",
                  "fileExtension": "jpg",
                  "id": 33155,
                  "sizeInBytes": 138780,
                  "title": "119000/-INR per person"
                }
              },
              "dataType": "document",
              "label": "Select photo",
              "name": "DocumentLibrary78180319",
              "nestedContentFields": [],
              "repeatable": false
            },
            {
              "contentFieldValue": {
                "data": "fieldfield 2 after change"
              },
              "dataType": "string",
              "inputControl": "text",
              "label": "field 2",
              "name": "Text72087547",
              "nestedContentFields": [],
              "repeatable": false
            }
          ],
          "repeatable": false
        }
      ],
      "contentStructureId": 33116,
      "title": "nested field structure contents after update"
    }

 

Did this article resolve your issue ?

Legacy Knowledge Base