cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Adding "SortbyColumns" to the statemecauses "Incompatible type.

Hello,
 
Would you please help with the following.
There is a statement that works perfectly:

 

Set(SelectedObjectName, First(Filter('[dbo].[Objects]', ParentObjectId = WorkingParentObjectId)).Name)

 

Now I need to sort data output before taking the first record. I use SortByColumns function, like this:

 

Set(SelectedObjectName, First(SortByColumns(Filter('[dbo].[Objects]', ParentObjectId = WorkingParentObjectId), "SortOrder")).Name)

 

And immediately get "Incompatible type..." error, like below:
 
Incompatible type error.PNG
I assume that this is because delegation cannot be used and statement cannot be resolved.
Does anybody know work-around? 
Thank you! 
2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User III
Super User III

Re: Adding "SortbyColumns" to the statemecauses "Incompatible type.

@DenisSkorskiy
Actually, it’s because SortColumns is missing an argument


Set(SelectedObjectName, First(SortByColumns(Filter('[dbo].[Objects]', ParentObjectId = WorkingParentObjectId), “YourSortColumn1”, Ascending)).Name)

—-
Please Accept as Solution if this post answered your question so others may find it more quickly. If you found this post helpful consider giving it a Thumbs Up.

View solution in original post

Highlighted
Frequent Visitor

Re: Adding "SortbyColumns" to the statemecauses "Incompatible type.

It is very strange.

In the reference it is said that SortOrder is optional.

Just for the sake of curiosity, I set this third parameter - and error disappeared.

Needless to say that I use this function with just two parameters in other places of the application and it works perfectly.

 

mdevaney, thank you!

View solution in original post

2 REPLIES 2
Super User III
Super User III

Re: Adding "SortbyColumns" to the statemecauses "Incompatible type.

@DenisSkorskiy
Actually, it’s because SortColumns is missing an argument


Set(SelectedObjectName, First(SortByColumns(Filter('[dbo].[Objects]', ParentObjectId = WorkingParentObjectId), “YourSortColumn1”, Ascending)).Name)

—-
Please Accept as Solution if this post answered your question so others may find it more quickly. If you found this post helpful consider giving it a Thumbs Up.

View solution in original post

Highlighted
Frequent Visitor

Re: Adding "SortbyColumns" to the statemecauses "Incompatible type.

It is very strange.

In the reference it is said that SortOrder is optional.

Just for the sake of curiosity, I set this third parameter - and error disappeared.

Needless to say that I use this function with just two parameters in other places of the application and it works perfectly.

 

mdevaney, thank you!

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (6,772)