cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
pwrappr01 Helper IV
Helper IV

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

TopShelf-MSFT Community Champion
Community Champion

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 Helper IV
Helper IV

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
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (6,684)