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

Can a PowerApp verify entries to be added to a SharePoint List do not already exist?

I have a SharePoint list in which users are going to choose their names from a drop-down and then choose an item from a drop-down. I need a way to check and see if the person has already added that item to a list. Is there a way to have a PowerApp check to see if, say, Bill R already has an entry for Ice Cream? I figured this might be possible via concatenating the [Name] and [EntryID], but I am unsure where this would go or how to have it search already-existing items.

 

If a match is found, I want it to prevent the user from inserting. If there is no match, I want it to add the item to the list.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Can a PowerApp verify entries to be added to a SharePoint List do not already exist?

@pwrappr01 

Yes this is perfectly possible in PowerApps...however, there comes new ways to consider this.

1) Do you want the user to make the entry and then get an error?

    This is very "code-ish" and...who likes to see an error?  You will need to put in the formulas to lookup the chosen item in the other list, and then Notify the user if it exists.

 

If(
IsBlank(Lookup(myList,
Name=NameDropDown.Selected.Name && Entry.Value=ItemDropDown.Selected.Value).ID),
submitInformation, // Nothing found that already exists
Notify("Release the dogs...you already have one of those in the list") //found something, alert user
)

 

 

2) Do you want the user to make the entry but then not be able to submit (disabled submit)?

 

Submit Button - DisplayMode property:
If( IsBlank(Lookup(myList, Name=NameDropDown.Selected.Name && Entry.Value=ItemDropDown.Selected.Value).ID), Edit, // Nothing found that already exists, enable button Disabled //found something, disable button )

 

 

3) Do you want the user to not even see any entries that can not be chosen?

Entry DropDown Items property:

Filter(ListOfEntryOptions, 
            !(Value In Filter(myList, 
                             Name=NameDropDown.Selected.Name).Entry
             )
      )

This would give you a filtered list of the available options that are not in the list already.  

The user could only choose items that are not already there.

 

Of course, none of the above is meant to be copy and paste into functioning formulas.  Adjustments to your scenario are needed. But, they can serve as a good starting point.

 

I hope this is helpful for you.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

3 REPLIES 3
Super User
Super User

Re: Can a PowerApp verify entries to be added to a SharePoint List do not already exist?

@pwrappr01 

Yes this is perfectly possible in PowerApps...however, there comes new ways to consider this.

1) Do you want the user to make the entry and then get an error?

    This is very "code-ish" and...who likes to see an error?  You will need to put in the formulas to lookup the chosen item in the other list, and then Notify the user if it exists.

 

If(
IsBlank(Lookup(myList,
Name=NameDropDown.Selected.Name && Entry.Value=ItemDropDown.Selected.Value).ID),
submitInformation, // Nothing found that already exists
Notify("Release the dogs...you already have one of those in the list") //found something, alert user
)

 

 

2) Do you want the user to make the entry but then not be able to submit (disabled submit)?

 

Submit Button - DisplayMode property:
If( IsBlank(Lookup(myList, Name=NameDropDown.Selected.Name && Entry.Value=ItemDropDown.Selected.Value).ID), Edit, // Nothing found that already exists, enable button Disabled //found something, disable button )

 

 

3) Do you want the user to not even see any entries that can not be chosen?

Entry DropDown Items property:

Filter(ListOfEntryOptions, 
            !(Value In Filter(myList, 
                             Name=NameDropDown.Selected.Name).Entry
             )
      )

This would give you a filtered list of the available options that are not in the list already.  

The user could only choose items that are not already there.

 

Of course, none of the above is meant to be copy and paste into functioning formulas.  Adjustments to your scenario are needed. But, they can serve as a good starting point.

 

I hope this is helpful for you.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

Administrator
Administrator

Re: Can a PowerApp verify entries to be added to a SharePoint List do not already exist?

Thanks for posting in the community @pwrappr01 - can you review the above reply and update the thread when you have a chance? 

 

Thank you,

 

@TopShelf-MSFT 

pwrappr01
Level: Powered On

Re: Can a PowerApp verify entries to be added to a SharePoint List do not already exist?

I did a quick test and found that worked! Thank you for that help, @RandyHayes.

 

I will eventually implement in the app for values to populate a SharePoint Lookup column and passing the selections to a SharePoint list, so I will see how things go then.

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
Users Online
Currently online: 214 members 5,162 guests
Please welcome our newest community members: