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

Button to refresh data on datatable.

Hi,

I have a datatable whith this filter in place: 

If(
    IsBlankOrError(dropDown.Selected),
    'myList',
    Filter(
        'myList',
        dropDown.Selected.Title = Title
    )
)

I'm using a dropdown which lists the "Titles" from a different list. When a "Title" is selected that matches the title from the datatable it filters it to it. When a user selects a value from the dropdown it filters just fine, but there is no option to just pull up everything that's  on the list again without reloading the whole app. 

I was thinking about adding a button that will refresh the data on the datatable, but the refresh() function doesn't seem to update anything. 

 

Can anyone point me in the right direction to accomplish this? 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

HI @_sourcecod3_ ,

Do you want to load all records into the Data Table again from your SP List when you press a button within your app?

Is there a Blank value existed within your Dropdown box?

 

Based on the needs that you mentioned, I have made a test on my side, please take a try with the following workaround:

Set the OnStart property of the App control to following:

ClearCollect(
              TableCollection,
              'myList'
)

 

Set the Items property of the Dropdown box to following:

'yourAnotherList'.Title

Set the OnChange property of the Dropdown box to following:

ClearCollect(
               TableCollection,
               Filter('myList', Title = dropDown.Selected.Title)
)

 

Set the Items property of the Data Table control to following:

TableCollection

Add a Button control (called "Reset Data") within your app, set the OnSelect property to following:

ClearCollect(
              TableCollection,
              'myList'
)

Please consider take a try with above solution, then re-load your app, then check if the issue is solved.

 

In addition, if the Default value within your Dropdown box is Blank, you could also consider take a try with the following workaround:

Add a button control (called "Reset Data") within your app, set the OnSelect property to following:

Reset(dropDown)           /* <-- dropDown represents the Dropdown control in your app */

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-xida-msft
Community Support
Community Support

HI @_sourcecod3_ ,

Do you want to load all records into the Data Table again from your SP List when you press a button within your app?

Is there a Blank value existed within your Dropdown box?

 

Based on the needs that you mentioned, I have made a test on my side, please take a try with the following workaround:

Set the OnStart property of the App control to following:

ClearCollect(
              TableCollection,
              'myList'
)

 

Set the Items property of the Dropdown box to following:

'yourAnotherList'.Title

Set the OnChange property of the Dropdown box to following:

ClearCollect(
               TableCollection,
               Filter('myList', Title = dropDown.Selected.Title)
)

 

Set the Items property of the Data Table control to following:

TableCollection

Add a Button control (called "Reset Data") within your app, set the OnSelect property to following:

ClearCollect(
              TableCollection,
              'myList'
)

Please consider take a try with above solution, then re-load your app, then check if the issue is solved.

 

In addition, if the Default value within your Dropdown box is Blank, you could also consider take a try with the following workaround:

Add a button control (called "Reset Data") within your app, set the OnSelect property to following:

Reset(dropDown)           /* <-- dropDown represents the Dropdown control in your app */

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-xida-msft Both of these options worked perfeclty. Thank you so much!

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.

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
Top Kudoed Authors
Users online (3,486)