How can I extract the geojson of a layer map loaded from UI on Quicksight using the API?

Hi everyone,

I have created a Quicksigight dashboard that contains a visual of a layer map set by passing a geojson through the UI.
Now I want to update the geojson programmatically without having to work on the UI each time. Is there a way to do this?

I made an attempt by extracting the visual via AWS CLI with “describe-dashboard-definition” but I saw that in the ChartConfiguration section related to the Layer map I get this:

...
"ChartConfiguration": {
    "MapLayers": [
        {
            "LayerId": <LAYER_ID>,
            "LayerType": "POLYGON",
            "DataSource": {
                "StaticFileDataSource": {
                    "StaticFileId": <STATIC_FILE_ID>
                }
            },
            "Label": "Layer 1",
            "Tooltip": {
                "TooltipVisibility": "VISIBLE",
                "SelectedTooltipType": "DETAILED",
                "FieldBasedTooltip": {
                    "AggregationVisibility": "HIDDEN",
                    "TooltipTitleType": "PRIMARY_VALUE",
                    "TooltipFields": []
                }
            },
            "JoinDefinition": {}
        }
    ],
    ...
},
...

I see that an id of a “StaticFileId” is shown in the DataSource section. How do I access this file?

I tried looking in the documentation but couldn’t find anything. Do you have any ideas how to do this?

1 Like

Hello @sdanilos , welcome to the QuickSight community!

After doing testing on my end I don’t think there is an API for this yet. Using start-asset-bundle-export-job with an analysis that has a layered map I got the error below:

"Errors": [
        {
            "Arn": "arn:aws:quicksight:us-east-1:[account-id]:asset-bundle-export-job/[analysis-id]",
            "Type": "com.amazonaws.services.quicksight.model.InvalidParameterException",
            "Message": "Please provide export destination to export images."
        }
    ]

I will mark this as a feature request for the QuickSight team. In the meantime, I think the only real workaround is updating this manually.