Hello, I believe I found a bug in cross sheet control SDK:
I have a process to migrate analysis cross our development environments, these scripts uses python boto3 SDK to fetch the dev
analysis definition and update/create the analysis in production
.
But when I apply cross sheet controls and apply them to the top of any sheet my scripts fail, because in the analysis the definition the FilterControls
parameter are empty
'Sheets': [{'SheetId': '9d10f332-8971-42ca-82b5-e8f34fb2509d',
'Name': 'Sheet 1',
'FilterControls': [{}],
Error:
ClientError: An error occurred (ValidationException) when calling the UpdateAnalysis operation: 1 validation error detected: Value '[FilterControl(dateTimePicker=null, list=null, dropdown=null, textField=null, textArea=null, slider=null, relativeDateTime=null, crossSheet=null)]' at 'definition.sheets.1.member.filterControls' failed to satisfy constraint: Only 1 member of [dateTimePicker, list, dropdown, textField, textArea, slider, relativeDateTime, crossSheet] should be provided for structure FilterControl
Also I tried to remove the empty values in the FilterControls list, but I got another error:
InvalidParameterValueException: An error occurred (InvalidParameterValueException) when calling the UpdateAnalysis operation: LayoutElement doesn't exist.
at LayoutElement: 6ebbba20-445f-4b5c-83c8-b44591530c59 of type: FILTER_CONTROL,
at Sheet 9d10f332-8971-42ca-82b5-e8f34fb2509d.
This error is caused because the filter control in the sheet definition has no element ID reference, that should be found in the FilterControls list:
'SheetControlLayouts': [{'Configuration': {'GridLayout': {'Elements': [{'ElementId': '6ebbba20-445f-4b5c-83c8-b44591530c59',
'ElementType': 'FILTER_CONTROL',
'ColumnSpan': 2,
'RowSpan': 1}]}}}],
When I convert the cross sheet control to only one sheet, everything works fine. Now FilterControls had the right value, with the FiltrerControlId = to the ElementID (6ebbba20-445f-4b5c-83c8-b44591530c59)
'Sheets': [{'SheetId': '9d10f332-8971-42ca-82b5-e8f34fb2509d',
'Name': 'Sheet 1',
'FilterControls': [{'Dropdown': {'FilterControlId': '6ebbba20-445f-4b5c-83c8-b44591530c59',
'Title': 'test equals',
'SourceFilterId': '906cacd1-1db1-40f1-85e8-67550ffc9126',
'DisplayOptions': {'SelectAllOptions': {'Visibility': 'VISIBLE'},
'TitleOptions': {'Visibility': 'VISIBLE', 'FontConfiguration': {}}},
'Type': 'MULTI_SELECT'}}],
'SheetControlLayouts': [{'Configuration': {'GridLayout': {'Elements': [{'ElementId': '6ebbba20-445f-4b5c-83c8-b44591530c59',
'ElementType': 'FILTER_CONTROL',
'ColumnSpan': 2,
'RowSpan': 1}]}}}]
To replicate this error, you can create a simple analysis with two sheets, one visual in each sheet, add one cross sheet control and it to the top of the sheet.
If it is not a bug, could you help me to fix it?