cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Meneghino
Community Champion
Community Champion

Issue: gallery Default property working with collection but not live data source

As you can see in this thread started by @lifelongjourney the Default property of a gallery will not work properly if the Items are a live data source but will do when the Items are a collection cached in memory.

It would be great if this could be investigated/clarified/resolved.

Many thanks for the efforts of the programme team.

6 REPLIES 6
v-micsh-msft
Community Support
Community Support

Hi @Meneghino,

 

I checked the thread you referenced.

And tried the method you have discribed in that thread.

And based on my understandings, the Default property expects a record value, and use first() or the Last() function directly on the data source works from my side.

With no errors occurred in PowerApps studio, and the Default would show me the filtered item after I specify the formula.

39.PNG

I may not get the point here, and if convenient, please share the steps to reproduce the scenario.

Regards

 

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

Hi @v-micsh-msft thanks for following up.

Here are the steps.  My data source is an Access Web App table, but in the thread by @lifelongjourney the source was a SharePoint list. The result is the same.

 

  1. Create a blank app with just one screen, and connect your data source
  2. Create a gallery and set its Items property to MyDataSource and Default to Last(MyDataSource)
  3. Create a text box in the gallery template to show the title/Id column of MyDataSource, i.e. ThisItem.Title
  4. Create a text box outside the gallery (TextboxLast) and set its Text to Last(MyDataSource).Title
  5. Create another text box outside the gallery (TextBoxSelected) and set its text to Gallery1.Selected.Title
  6. Save, close and re-open the app

Now, TextBoxSelected is blank when the app is opened, but if Default was working properly then it should show the same as TextBoxLast.  This is the problem.

 

I have just done the above again and the result is the same.  I am very surprised that in your case it works, what is your data source?

 

__.JPG

Hi @Meneghino,

 

Thanks for the detailed responses.

I will test this again and reply back.

Regards

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

Hi @Meneghino,

 

I tested again, with some further trying out.

Data source is downloaded from the following website: Financial sample

https://powerbi.microsoft.com/en-us/documentation/powerbi-sample-download-the-financial-sample-workb...

Save this file into OneDrive or OneDrive for Business, the data is already formatted as an Excel table (Financials).

Following your guide, the Gallery1.selected.country would show me the right value with the textbox above (The same result with IOS devices):

40.PNG

 

If convenient, please help to confirm this.

I tested with the SharePoint list item, and SQL Server table also, and this time it shows the results as you mentioned, which the Gallery.selected value is not displayed under the Text box.

If there are some more aspects that should be considered, please let me know, I will then send out the feedback from my side.

Regards

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

Hi @v-micsh-msft, thanks again for following up.

I tried with financials as you suggested and indeed Default works as expected.

No other aspects come to mind at the moment, except that a Reset property for galleries would be appreciated, as outlined here:

https://powerusers.microsoft.com/t5/PowerApps-Ideas/Add-a-Reset-property-to-galleries/idi-p/18128

Hi @Meneghino,

 

Issue has been reported. But currently no response.

I will update it here once I got any feedback.

Regards

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

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (2,385)