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

Check if a item exist in a Sharepoint multivalue drop down field

I have created a app, and need to have an indicator if a Product  in a "product field" already  exist in the list.

 

In a Sharepoint list called "Service" With a Field called "Products", and  I have a lookup Field from "Service" to the SharePoint list "Productlist".   The "Products" Field lookup from "Productlist" and it is possible to Select multiple values in the Products Field. 

 

A item in the "Service" list can have 3-5 values in the Products Field, eg. "Prod 001", "Prod 002", "Prod 003".

 

My need is when i create a New element in the "Service" list (using a Power App Application", i need to do a check if the actual Product that is selected in the "Products" Field, already exist in another item in the service list, and i like to get an Notification on the screen. 

 

Example:  Sharepoint list: Service

Title                             Date                     Products

Problem 1                    01.01.2020           Prod 001, Prod 002

Problem 2                    02.01.2020           Prod 002, Prod 003, Prod 004

 

If i then register a nw item: Problem 3, and the "Prod 002" is selected in the Products Field, i like to get an Notification on the screen. 

Any idea how to solve this.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft v-siky-msft
Microsoft

Re: Check if a item exist in a Sharepoint multivalue drop down field

@TrulsB,

 

I made a test on my side, I use EditForm to create a new element, please put the following codes to OnSelect property of Submit button.

Clear(MyCol);
ForAll( Service,ForAll(DataCardValue1.SelectedItems,If(Id in Products.Id,Collect(MyCol,true))));
If(true in MyCol,Notify("Error",NotificationType.Error),SubmitForm(FormName))

Note: DataCardValue1 is the combo box name of Products field.

Snipaste_2020-02-05_11-55-42.png

Sik

View solution in original post

1 REPLY 1
Microsoft v-siky-msft
Microsoft

Re: Check if a item exist in a Sharepoint multivalue drop down field

@TrulsB,

 

I made a test on my side, I use EditForm to create a new element, please put the following codes to OnSelect property of Submit button.

Clear(MyCol);
ForAll( Service,ForAll(DataCardValue1.SelectedItems,If(Id in Products.Id,Collect(MyCol,true))));
If(true in MyCol,Notify("Error",NotificationType.Error),SubmitForm(FormName))

Note: DataCardValue1 is the combo box name of Products field.

Snipaste_2020-02-05_11-55-42.png

Sik

View solution in original post

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,311)