cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Lookup items from one list based on column values in another list

My PowerApps form contains a field that is a lookup column in a SP list (Eq. Master), the SP column is named ID (this column contains a static list of bar-code values).  

 

Without getting into the details of my PowerApps form and associated SP lists, I need to get suggestions on how to go about solving an issue (it's really a feature, that I'd like to have).  My app's Form collects details about specific equipment ID's and inserts the form content into a "target" SP list.  The user selects the specific Eq ID using a drop-down box (this is from a different SP list, I'll call it the "source" list).  Depending on the situation, the user can use two dropdowns, each pulling items from the same SP list/column (both dropdowns pull from the "source" list, Eq ID field).

 

Here's what I'd like to do: as items are "inserted" into the "target" list , I'd like to "remove" these IDs from the dropdown items the user selects from (both dropdowns).  So, the net effect is that once an ID has been added to the target list (in either ID field), then it does not appear as available to the user to select a second-time.  See attached image, I don't want the target list to have duplicate items between the two ID fields.  As you can see in the image, both ID One and ID two columns have a value of C1002, this is what I want to avoid.

 

I'm pretty much a novice at PowerApps, so please consider that when making suggestions.  Your assistance is appreciated.

 

SteveG

3 REPLIES 3
Highlighted
Community Support
Community Support

Re: Lookup items from one list based on column values in another list

Hi @Sgriffin ,

 

I think this cannot be achieved using PowerApps, but you can make it work by setting from the SharePoint list side.

When creating the Lookup column "ID", please check the Enforce unique values to Yes. After this, this field would appear as a dropdown control inside the edit form and you will see the options from the source list. If user selects a value that has already in use, then he won't be able to save this item with the edit form.

Capture.JPG

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Regular Visitor

Re: Lookup items from one list based on column values in another list

Thanks for your reply, but I don't that will work because the SP list has two ID columns (you'll see an example of this in the image I uploaded).  Is there a way to enforce uniqueness between these two columns?

 

Thanks again.

Highlighted
Community Support
Community Support

Re: Lookup items from one list based on column values in another list

Hi @Sgriffin ,

 

I'm afraid that this cannot be achieved. You cannot force unique between 2 columns.

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Ignite

Microsoft Ignite

This will be a conference that you do not want to miss!

secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (3,788)