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

Date data range issue

Hello,

 

I have a button, 2 date fields:

 

Emont_2-1643838937966.png

And I am trying to update a datatable when the Buscar button is pressed, but is showing an error with 'Fecha Actual' which is a column in my SharePoint, but is showing the error below:

 

Emont_0-1643838812288.png

 

What would be wrong and how to fix it?

 

Thanks for the help.

4 REPLIES 4
Emont
Helper II
Helper II

I was able to fix it :

 

Filter(RangoFecha, 'Fecha Actual' >= FechaInicio.SelectedDate && 'Fecha Actual' <= FechaFinal.SelectedDate)

 

But now the DataTable is not refreshing now. how can I refresh it?

RandyHayes
Super User
Super User

@Emont 

What is the Items property of your Datatable?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

It is the name of the SharePoint List which is: Datos_Generales_DockLogistic

RandyHayes
Super User
Super User

@Emont 

Well, your original formula really does nothing except to load 500 records into a collection.

I assume that is on the OnSelect action of the button.  

In that formula you are using the Filter function, but all of the filtered table results go nowhere - you are not assigning them to anything and thus, they simply all go away.

 

You don't really need the button to perform the search.  You can simply have your datatable respond to the date range.

In that scenario, the formula for the Items property of your datatable would be:

Filter(Datos_Generales_DockLogistic, 
    'Fecha Actual' >= FechaInicio.SelectedDate && 'Fecha Actual' <= FechaFinal.SelectedDate
)

 

If you need more of a "click to do it" method with a button, then change your OnSelect action on the button to:

Set(glbRecords,
    Filter(RangoFecha, 'Fecha Actual' >= FechaInicio.SelectedDate && 'Fecha Actual' <= FechaFinal.SelectedDate)
)

Then change your DataTable Items property to: glbRecords

 

Otherwise, what you have not for the Datatable is just the datasource...it will always be just that.  In PowerApps you need to specify the table that you want to use for Items properties.  Your other formulas will do nothing to impact that property.

 

I hope this is clear and helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,400)