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
News & Announcements

Community Blog

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

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

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