cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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

View solution in original post

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

View solution in original post

tugba
Level: Powered On

Re: geting second data from listbox

Thank you.It is working:)


@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
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 (4,708)