Forum Discussion
Sort by using Visuals API
Hey Zubair, and thanks very much for teaching me something new (to me!) 🙂
Being as I wasn't too informed on my previous post, I'd take what I say next with a grain of salt, but I haven't been able to find this myself in any previous (or current) projects and have deferred to using the visual header to manage.
I've never seen details on sort by column metadata for a field in the API, and if the sort values aren't in the dataset, they could not be used internally. It is likely that core visuals have more direct access to the data model as they are not sandboxed, or there are APIs that have not been promoted to the custom visuals SDK.
If there isn't an API to bring in from core, something new on the visual host would be ideal for this, i.e.:
interface IVisualHost {
...
applySort(columns: DataViewSortColumn[]) /* New */
}
interface DataViewSortColumn {
queryName: string,
direction: 'ascending' | 'descending'
}
(the param doesn't have to be an array, but sorting by multiple columns would be neat to achieve also)
Either way, I think it's better asked directly to the visuals team, or creating an issue in the GitHub repo for some dedicated assistance.
Regards,
Daniel
Thanks Daniel dm-p
I really like this suggestion of applysort in IVisualHost.
I emailed to pbicvsupport as well for help. Waiting for their reply now.
- Anonymous4 years agoNot applicable
Please kindly share your workaround in your Post if you find the solution to your problem. This will help many other people with the same problem like yours.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.