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

geting second data from listbox

I have 3 item in listbox. And i fill listbox from database with distinct and filter function. Now ı need to take second item in listbox.Is it possible to take second item in listbox?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: geting second data from listbox

Hi @tugba 

 

Do you want to get the second item in the list box?

You can use this formula expression:Last(FirstN(datasource,2)).ColumnName

 

For example, 

DataSource:Customers

lastdatasource.PNG

 

ListBox2.Items=Customers.Name 

label8.Text=Last(FirstN(Customers.Name,2)).Name

last.PNG

 

 

More information:

function-first-last

 

 

Best Regards.

Yumia

3 REPLIES 3
jhall
Level 8

Re: geting second data from listbox

Do you mean a second DataSource (e.g. tblPeopleUS, tblPeopleCA) or do you mean a second value attached to the individual list items (e.g. tblPeople, tbleAddresses)?

Regardless, if any of this ever gets confusing, you can always create a Collection first before you need the List and then point the DataSource at the Collection.  So you could do whatever you need to do to build the Collection first just until you sort out the exact function formatting for a one-liner.

Community Support Team
Community Support Team

Re: geting second data from listbox

Hi @tugba 

 

Do you want to get the second item in the list box?

You can use this formula expression:Last(FirstN(datasource,2)).ColumnName

 

For example, 

DataSource:Customers

lastdatasource.PNG

 

ListBox2.Items=Customers.Name 

label8.Text=Last(FirstN(Customers.Name,2)).Name

last.PNG

 

 

More information:

function-first-last

 

 

Best Regards.

Yumia

tugba
Level: Powered On

Re: geting second data from listbox

Thank you.It is workingSmiley Happy


@v-yuxima-msft wrote:

Hi @tugba 

 

Do you want to get the second item in the list box?

You can use this formula expression:Last(FirstN(datasource,2)).ColumnName

 

For example, 

DataSource:Customers

lastdatasource.PNG

 

ListBox2.Items=Customers.Name 

label8.Text=Last(FirstN(Customers.Name,2)).Name

last.PNG

 

 

More information:

function-first-last

 

 

Best Regards.

Yumia


 

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

Users Online
Currently online: 211 members 4,602 guests
Please welcome our newest community members: