cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Thomasjruss
Frequent Visitor

SP List: Listing Unique Items from Lookup Column, Saving Them

 

Hello!

 

I have two lists:

Main list: Dummy Enforcement Workflow

Lookup reference list: Contact List Conversion

 

In the lookup reference list, there is a column with employee names, all of which have duplicates. I do not want to see duplicate values in the items in the data card that references the Contact list, and I still want the SP list form to save the selected values. 

 

Thank you! That's the gist of the problem. Please read on if you would like more information.

 

When I simply use distinct(choices(['@Dummy Enforcement Workflow']),Values), it will display the unique items if I change the field properties to select the 'Results' output. However, the app will not save the selected items to the list.

I understand that the results are in text, and the list is expecting a record. I believe that is where my problems arise. I have tried using Patch in the On Select Property, to no avail.

 

When I use the below formulas, I get three rows added to the list when I select a contact. One of the three gives me what I would expect. However, I also get two other blank rows that I do not want.

Thomasjruss_0-1653677432024.png

 

 in the Items property

 

Thomasjruss_1-1653677432029.png

 

 in the On Select property

1 ACCEPTED SOLUTION

Accepted Solutions
Thomasjruss
Frequent Visitor

My solution follows:

 

DataCardValue10 (Column Datacard) Items property = Distinct(Choices([@'Dummy Enforcement Workflow 2'].OData__x0045_OA2),Value)

 

Column_DataCard Update property = 

{
Value: DataCardValue10.Selected.Result,
Id:
LookUp(
'Contact List Conversion',
Title = DataCardValue10.Selected.Result
).ID
}

View solution in original post

3 REPLIES 3
Drrickryp
Super User
Super User

@Thomasjruss 

Welcome to PowerApps hel1.  See numbers 1 and 2 in my post https://powerusers.microsoft.com/t5/Power-Apps-Community-Blog/The-Ten-Commandments-of-SharePoint-in-... 

My suggestion would be to create a new list of your employee's names and reference it's ID in the workflow list. 

Thomasjruss
Frequent Visitor

Okay, thanks @Drrickryp. I'm learning. The contact list has duplicates because people can have multiple roles. So for instance, Marky Mark will have a row where they are listed as an investigator and a row where they are listed as an analyst. 

 

I changed the data field that I want the name entered in to single text per the commandments. In the case of this app, I want the users to be able to see the options for names of people that are investigators, and to be able to select them and save them in the data field. Now I'm confused because I have a combobox control showing names filtered by investigator roles, but I still can't get the datacard to update with the selection. 

 

I believe I'm having a hard time wrapping my head around commandment 2. There are ID values in the contact list.

 

Any ideas?

 

Thanks,

Thomas

Thomasjruss
Frequent Visitor

My solution follows:

 

DataCardValue10 (Column Datacard) Items property = Distinct(Choices([@'Dummy Enforcement Workflow 2'].OData__x0045_OA2),Value)

 

Column_DataCard Update property = 

{
Value: DataCardValue10.Selected.Result,
Id:
LookUp(
'Contact List Conversion',
Title = DataCardValue10.Selected.Result
).ID
}

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (1,825)