Dashboard created via APIs shows error

I am creating dashboards for tenants via APIs from a master dashboard. I am first calling describeDashboardDefinition API, then update dataset Arns, and finally call createDashboard API. I have created multiple dashboards in this way, but one metric in the newly created dashboard displays error “Your Calculated field expression contains invalid syntax. Correct the syntax and try again.” Error details are
Error details

region: us-east-1
timestamp: 1693337357027
requestId: 834126d2-cafa-4e0b-8e91-51b91403b423
sourceType: PGSQL

If I create the same dashboard from an analysis with the same datasets then there is no error.

@qsuser you should try that with the template…
analysis > template > dashboard are the correct steps for API

Hi @nshah-quicksight,
Thanks for the quick response. I thought that template creation was an older way and that new APIs allow direct dashboard creation. What is the difference if I generate a JSON file and use this file to create a dashboard via CLI or do the same thing via API?

New Amazon QuickSight API Capabilities to Accelerate Your BI Transformation | AWS News Blog


if you do it with the template, you are storing the definition analysis on QS, and then asking QS to use that to create a dashboard, Much simpler and doesn’t have to deal with JSON for the analysis, which will get more and more complex as you add stuff.

But we live in a free world, and you can choose any path you want. :wink:

So in your case; Clearly, there is something in JSON that the create-dashboard API doesn’t like as mentioned in the error. You can start debugging your JSON in the calculated fields section.

Hi @nshah-quicksight , Thanks.
Dashboard creation from a template is working. I have created cli-input files and hopefully, this can be automated via APIs.
My existing SDK based automation worked successfully for the first 5 deployments. JSON input to create-dashboard API is copied from the master dashboard definition.

1 Like

Update: Dashboard creation via API has started working again. AWS has resolved this issue.