You'll need 2 steps in your code:
- Read the filters on dashboard 1.
- Pass the filters to dashboard 2.
However, if you are going over the limits described above or you need to get relevant values of cascading filters, you will need to read the values from a helper sheet. Therefore, for each one of your filters, you'll want to create one sheet that shows the selected values of said filter (i.e. have the dimension on rows, and set the filter to apply on this new sheet). Since this is only a helper sheet, you'll want to 'hide' it, using the technique described here: https://tableauandbehold.com/2016/02/19/using-a-hidden-sheet-for-advanced-action-filtering/. Once you have that setup, you can access the helper sheets like any other and get the values on rows using the getSummaryDataAsync method (API Reference - Tableau). An example of GetData is here (note you'll want to use getSummaryDataSync instead of getUnderlyingDataAsync).
Hope this helps!