cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Naesio
Level: Powered On

How to insert data from a table in the Gallery screen?

I am having doubts on how I can code or read data from a table.

 

I would like to see in the first option the "Item_Code" field and in the second field below the name "Item_Name".

It's important to note that you would not like to affect the search and ordering code for the gallery. 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: How to insert data from a table in the Gallery screen?

@Naesio 

You need not worry about the Textbox to do anything.  In PowerApps, things "respond" to other controls, controls don't usually alter other things.

So, looking at your original default formula for your Gallery Items Property is the place to start.

You can see that it had two functions in it - the SortByColumns and the Search function.  You will need to apply those to your Gallery Items property as well.

Consider altering this formula for your needs:

SortByColumns(
    Search(yourDataSource, 
                TextSearchBox4.Text,
                "yourColumnYouWantToSearchInQuotes"),
    "yourColumnYouWantToSortByInQuotes",
    If(SortDescending1,
       SortOrder.Descending,
       SortOrder.Ascending)
)

This will give you similar functionality for searching and sorting that you were asking for, but you need to apply your datasource and your columns.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

5 REPLIES 5
Super User
Super User

Re: How to insert data from a table in the Gallery screen?

@Naesio 

As long as you have those columns in your DataSource and you have connected your DataSource to the Gallery, you can quickly edit those labels in the "Fields - Edit" under the Gallery properties on the right properties pane.  

There you can select whatever columns you have in your DataSource to display them.

 

I hope that is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Naesio
Level: Powered On

Re: How to insert data from a table in the Gallery screen?

Hi, @RandyHayes for your quick answer.

 

But...I'm not seeing exactly the field mentioned. Would these be featured? And what code would you use to extract the information from the table? 

 

Appreciate your time.  

Super User
Super User

Re: How to insert data from a table in the Gallery screen?

@Naesio 

You are using CutomGallerySample as your DataSource!  Pretty sure you don't want the built-in sample data to be your data.  You will need to put your DataSource in the property and adjust your formula to the columns that are in your datasource.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Highlighted
Naesio
Level: Powered On

Re: How to insert data from a table in the Gallery screen?

Hey @RandyHayes one more time! Thank you! 

 

So...I took out a "Search Item" formula from the field and adding the name of the database. It worked as you instructed.

But I have another issue:

- How do I add a search item? (a mean the code and where?...on "TextSearchBox4"??? 

 

Once again appreciate your time. 

Super User
Super User

Re: How to insert data from a table in the Gallery screen?

@Naesio 

You need not worry about the Textbox to do anything.  In PowerApps, things "respond" to other controls, controls don't usually alter other things.

So, looking at your original default formula for your Gallery Items Property is the place to start.

You can see that it had two functions in it - the SortByColumns and the Search function.  You will need to apply those to your Gallery Items property as well.

Consider altering this formula for your needs:

SortByColumns(
    Search(yourDataSource, 
                TextSearchBox4.Text,
                "yourColumnYouWantToSearchInQuotes"),
    "yourColumnYouWantToSortByInQuotes",
    If(SortDescending1,
       SortOrder.Descending,
       SortOrder.Ascending)
)

This will give you similar functionality for searching and sorting that you were asking for, but you need to apply your datasource and your columns.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,206)