Start_asset_bundle_import_job API failed : Error: Error in InsightVisual <id> of Sheet<sheet-id>: The root element for Narrative XML should always be <narrative>

I am trying to set up a CD pipeline for QuickSight Assets using the export and import APIs.
I am attempting to import a bundle of assets present in zip file. The zip contains dashboards, datasets, datasources, theme and a vpc-connection.

The start_asset_bundle_import_job API fails to create the assets from this zip and it looks like it found an issue with the dashboard json

Error: Error in InsightVisual of Sheet : The root element for Narrative XML should always be

I tried to describe the dashboard definition of the dashboard in the source a/c and it turns out that particular block looks like this

{
    "InsightVisual": {
        "VisualId": "08f5746a-e29b-4fc0-9f6c-3cb7e9a63c9d_0388d5cf-f729-4070-a85a-9828209b7a74",
        "Title": {
            "Visibility": "HIDDEN"
        },
        "Subtitle": {
            "Visibility": "HIDDEN"
        },
        "InsightConfiguration": {
            "Computations": [],
            "CustomNarrative": {
                "Narrative": "<narrative/>"
            }
        },
        "Actions": [],
        "DataSetIdentifier": "New custom SQL"
    }
}

I would like to know why do I need to manually intervene because the larger picture is automation of these deployments.

What I have tried till now:
I changed the value Narrative to <narrative>\n</narrative> instead of <narrative/>
However, I am getting the same error

Hello @Abhra , welcome to the Quicksight community!

Looking through the documentation, and I think you may need to add the narrative that is in your custom insight for it to work.

CustomNarrative → (structure)

The custom narrative of the insight visual.
Narrative → (string)

The string input of custom narrative.

Or will the narrative be totally different each time?

1 Like

Try <narrative>&nbsp;</narrative>

1 Like

Hello @Abhra ! Are you still having running into this issue? We would like to help solve your problem but we have not heard from you in a few days. If we don’t hear from you in 3 days this post will be archived.

Hello @duncan, the original dashboard in our source account does not have any narrative associated with it in that particular insightVisual.
However, I did make the change as @zhaopan advised.

{
  "insightVisual": {
    "visualId": "08f5746a-e29b-4fc0-9f6c-3cb7e9a63c9d_0388d5cf-f729-4070-a85a-9828209b7a74",
    "title": {
      "visibility": "HIDDEN"
    },
    "subtitle": {
      "visibility": "HIDDEN"
    },
    "insightConfiguration": {
      "computations": [],
      "customNarrative": {
        "narrative": "<narrative>&nbsp;</narrative>"
      }
    },
    "actions": [],
    "dataSetIdentifier": "New custom SQL"
  }
}

The import bundle job returns an error

Error: Error in InsightVisual 08f5746a-e29b-4fc0-9f6c-3cb7e9a63c9d_0388d5cf-f729-4070-a85a-9828209b7a74 of Sheet 08f5746a-e29b-4fc0-9f6c-3cb7e9a63c9d_1eb3e53c-fd21-4fd2-b620-f3663b43fbec : The entity “nbsp” was referenced, but not declared.

Hello @Abhra !

Could you try Unicode character for a non-breaking space instead?

{
  "insightVisual": {
    "visualId": "08f5746a-e29b-4fc0-9f6c-3cb7e9a63c9d_0388d5cf-f729-4070-a85a-9828209b7a74",
    "title": {
      "visibility": "HIDDEN"
    },
    "subtitle": {
      "visibility": "HIDDEN"
    },
    "insightConfiguration": {
      "computations": [],
      "customNarrative": {
        "narrative": "\u00A0"  // Unicode character for non-breaking space
      }
    },
    "actions": [],
    "dataSetIdentifier": "New custom SQL"
  }
}

Hello @Abhra !

Are you still running into this issue and if so were you able to try the solution I posted above?

1 Like

I was able to resolve this by changing "customNarrative": { "narrative": "</narrative>" } to "customNarrative": { "narrative": "<narrative>test_string</narrative>" }

1 Like