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

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

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
Super User III
Super User III

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.

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

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.

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? 

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.

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

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

Amazing thank you!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Users online (7,181)