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

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

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

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 310 members 4,689 guests
Recent signins:
Please welcome our newest community members: