Domo Brick export to pdf

Hi everyone,

I have created a Domo Brick which shows a dropdown that is dynamically populated based on data from a dataset. The idea is that you select a value and it filters the whole dashboard. This works well and when I try to export the page as a pdf it shows all charts correctly filtered based on the current selection but the dropdown itself is shown with its initial value, not the currently selected on. This may confuse users since they select 'B' and then on the pdf the dropdown is telling them everything is filtered by selection 'A' while in truth the charts on the pdf are filtered by 'B'.

Hope that makes sense and someone may have an idea to resolve this.

Thanks

Thomas

Best Answer

  • ternst
    ternst Member
    edited November 25 Answer ✓

    Update:

    I figured it out:

    domo.onFiltersUpdate(result => {dropdown.value = result[0].values[0];});

    onFiltersUpdate will block the page filter from filtering my brick (which I want) + I can manually pick what the selected value is (result[0].values[0] works for me since I can only have one selection). Had to enable filtering on the brick for this to work.

Answers

  • It sounds like the PDF export process is capturing the initial value rather than its current state. I assume it is because the displayed value isn’t persisting its selection. You could try making sure there's a persisting variable tied to the dropdown. Make sure the dropdown value is explicitly updated and reflected in the rendered output of the component.

    You could try to explicitly display the selected value in the dropdown before exporting, by overriding the dropdown dynamically based on the applied filter.

    dropdown.value = FilterValue;
    

    ** Was this post helpful? Click Agree or Like below. **
    ** Did this solve your problem? Accept it as a solution! **

  • Thanks for the suggestion. Unfortunately it does not work.

    I think I understand what is happening here: My dropdown updates the global filter. So when the pdf is created it picks up the global filter and applies it to the dashboard. However, I set the brick to not be filtered by the global filter (otherwise selecting something from the dropdown will limit my dropdown choices to the one I selected). In any case, the global filter does not apply to the brick and therefore the pdf will show the initial state of the brick instead. I am wondering if there is anything else I could do.

  • ternst
    ternst Member
    edited November 25 Answer ✓

    Update:

    I figured it out:

    domo.onFiltersUpdate(result => {dropdown.value = result[0].values[0];});

    onFiltersUpdate will block the page filter from filtering my brick (which I want) + I can manually pick what the selected value is (result[0].values[0] works for me since I can only have one selection). Had to enable filtering on the brick for this to work.

  • ArborRose
    ArborRose Coach
    edited November 26

    Sounds great. Good job.

    ** Was this post helpful? Click Agree or Like below. **
    ** Did this solve your problem? Accept it as a solution! **