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

Populate List Box from another SharePoint list

Hello,

 

I have a PowerApps-enhanced SharePoint list form. 

 

On the form, there is a List Box named "ListDataAsset" with multi-select disabled, and a simple text field "TxtCriteria".

 

I want to populate the list box with data from another list named "Data Asset Test". Required data is in column "Name". I want to return only those records which contain in column "Name" the string noted in text field "TxtCriteria". The list "Data Asset Test" has 19k records.

 

Is this possible to be done? If yes, what function should I use? I tried various options with "Search", but none of my formulas worked.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Populate List Box from another SharePoint list

Hi @radenkovic_rr 

 

Is "Name" the actual name of the column, or was it renamed? if renamed, then you might need to use 'Name' with single quotes.

I tried to replicate the issue but the example I created using that formula worked.

 

Als did you check that Value being used is Name (in my case UserText is the name of the Column):

image.png

 

Cheers,

ManCat




Don't forget to 'Mark as Solution' and 'Thumbs Up' those who deserve it!

View solution in original post

6 REPLIES 6
Super User
Super User

Re: Populate List Box from another SharePoint list

Hi,

 

Have you tried something like:

Filter(DataSourceName, StartsWith(Name, TxtCriteria.Text))

 

This will then auto-filter as you are typing rather than after,

 

Cheers,

Sancho




Don't forget to 'Mark as Solution' and 'Thumbs Up' those who deserve it!
v-siky-msft
Level 8

Re: Populate List Box from another SharePoint list

Hi @radenkovic_rr 

 

To better understand your issue:

1. What is the data type of "ListDataAsset" column?

2. Can you show experssion of list box's Items property.

3. What is the error you meet?

4. Do you want the textcriteria to be at the beginning or anywhere?

 

First of all, the Search function and In operator aren't delegable to SharePoint, due to 19k records you have.

so it would be difficult to match the textcriteria to anywhere of Name column.

 

However, we can use the StartsWith function and EndsWith function (can be delegated ) to test whether Name column begins/ends with textcriteria.

Please try to put the following formulas to list box's Items property.

Filter('Data Asset Test',StartsWith(Name,ThisItem.TxtCriteria))

Annotation 2019-09-23 175832.png

Best regards,

Sik

radenkovic_rr
Level: Powered On

Re: Populate List Box from another SharePoint list

@iAm_ManCat , thank you very much for your reply. When I add the following formula in List Box Items

 

Filter('Data Asset Test',StartsWith("Name",TxtCriteria.Text))

 

The list box is populated with correct data, but as soon as I enter any text in TxtCriteria, all items are filtered out. Do you maybe know why?

 

@v-siky-msft  , thank you very much for your reply. When I add this formula in List Box Items:

 

Filter('Data Asset Test',StartsWith("Name",ThisItem.TxtCriteria))

 

I get an error saying "The Function StartsWith has some invalid arguments - Name isn't valid. This identifier isn't recognised" and the List Box doesn't get populated at all.

 

Regarding your questions:

1) ListDataAsset is not bound to any column, it is a support field which is used by the code.

2) The previous expression I tried was to use Search function, but that did not work - it was Search( 'Data Asset Test', TxtCriteria.Text, "Name" )

3) With formula under #2, I had an error "The specified column 'Name' doesn't exist"

4) Ideally, I would like the text criteria to be any part of string in search column

Super User
Super User

Re: Populate List Box from another SharePoint list

Hi @radenkovic_rr 

 

Is "Name" the actual name of the column, or was it renamed? if renamed, then you might need to use 'Name' with single quotes.

I tried to replicate the issue but the example I created using that formula worked.

 

Als did you check that Value being used is Name (in my case UserText is the name of the Column):

image.png

 

Cheers,

ManCat




Don't forget to 'Mark as Solution' and 'Thumbs Up' those who deserve it!

View solution in original post

radenkovic_rr
Level: Powered On

Re: Populate List Box from another SharePoint list

Hi @iAm_ManCat 

 

Thank you, enclosing the "Name" with single quotes did the trick.

Super User
Super User

Re: Populate List Box from another SharePoint list

You're welcome @radenkovic_rr, glad to help, thanks for letting us know it worked Cat Very Happy




Don't forget to 'Mark as Solution' and 'Thumbs Up' those who deserve it!

Helpful resources

Announcements
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

Top Kudoed Authors
Users Online
Currently online: 76 members 3,467 guests
Please welcome our newest community members: