cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper I
Helper I

Sort Data Table

 

Hi,

 

Can someone tell me whats wrong with the following formula please, trying to sort a column in my data table in date order.

 

SortByColumns('Secondary Media','Date and Time_Column1', If(Sortsecmed, Ascending,Descending)

 

Screenshot attached if needed.

 

Thank you

 

Gaz

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Champion
Community Champion

Re: Sort Data Table

Hi @Gazbeer ,

So I have this right (and pardon my parsing so I can read the formula better)

If(
     And(

          IsBlank(DataCardValue10),

         ( IsBlank(DataCardValue5)

     ) ),
     DisplayMode.Disabled,
     DisplayMode.Edit

)

The two red brackets are not required, but you need Or, not And (if either are blank, make it disabled) - so:-

If(
     IsBlank(DataCardValue10) || IsBlank(DataCardValue5),
     DisplayMode.Disabled,
     DisplayMode.Edit

)

View solution in original post

8 REPLIES 8
Highlighted
Community Champion
Community Champion

Re: Sort Data Table

Hi @Gazbeer ,

 

The first thing you are missing is a closing bracket at the end to close SortByColumns

I have not looked at the rest of it too hard, but it looks OK providing the controls references are correct.

Highlighted
Helper I
Helper I

Re: Sort Data Table

Hi Again 😂,

 

SortByColumns('Secondary Media','Date and Time_Column1'), If(Sortsecmed, Ascending,Descending)

 

I get a long red line under the ('Secondary Media','Date and Time_Column1') section.

 

Thanks

Highlighted
Community Champion
Community Champion

Re: Sort Data Table

Hi @Gazbeer ,

 

I should have looked harder - SortByColumns requires quotes "" around the column name being sorted.

 

Any reason you are not using Sort ? Your formula as present should work I think.

Highlighted
Helper I
Helper I

Re: Sort Data Table

Only because i don't know any other way of bring the latest entered piece of information to the top of the table. I'm sorry i'' quite new to this and am learning as i'm going. Is there a better way of doing it? 

Highlighted
Community Champion
Community Champion

Re: Sort Data Table

Hi @Gazbeer ,

You actually have three issues and I have only seen two of them until now.

Dates are not delegable filters (as I curse at times).

One workaround is to have a numeric value (DateValue) generated in the SharePoint list. I have a workaround tracking IDs and when they were created, but this only works on creation dates.

Highlighted
Helper I
Helper I

Re: Sort Data Table

Ah ok, bit of a nuisance then, whilst I've got you, I'm making a save button that is disabled until data is entered in multiple boxes. 

 

If(And(IsBlank(DataCardValue10), (IsBlank(DataCardValue5))), DisplayMode.Disabled,DisplayMode.Edit) 

 

is my formula, which works, but puts the button back in 'edit mode' if data is entered into any box individually, but i need info in all boxes before it turns it to edit.

 

Thank you

Highlighted
Community Champion
Community Champion

Re: Sort Data Table

Hi @Gazbeer ,

So I have this right (and pardon my parsing so I can read the formula better)

If(
     And(

          IsBlank(DataCardValue10),

         ( IsBlank(DataCardValue5)

     ) ),
     DisplayMode.Disabled,
     DisplayMode.Edit

)

The two red brackets are not required, but you need Or, not And (if either are blank, make it disabled) - so:-

If(
     IsBlank(DataCardValue10) || IsBlank(DataCardValue5),
     DisplayMode.Disabled,
     DisplayMode.Edit

)

View solution in original post

Highlighted
Helper I
Helper I

Re: Sort Data Table

Amazing thank you!

Helpful resources

Announcements
secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,115)