cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lparkerMDVIP
Helper III
Helper III

How to Restrict Users from Creating List Items a Second Time

Hello everyone!!

 

I have created a SharePoint List and have granted 365 dynamic groups access to it.

 

My current dilemma is that I need each user to only be able to submit one list item to the SP list.  I wanted to know if there is possibly a flow that could be created that would delete any new list items if a user has already contributed once to the SP List.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ccc333ab
Solution Sage
Solution Sage

Not sure if this was what you were asking, but this is what I think you are asking. 

 

1. Trigger your flow when a new item is created. 

2. Get all the items in your list filtered by the user that just created the item, but is NOT the same one that was just created (i.e., has the same id). 

 

ccc333ab_6-1625719510139.png

 

 

3. If any records are returned then you'll want to delete the items just created. However, if no records are returned, this is the first time this user has added an item and it'll do nothing. (Note, in my yes condition, I just have a compose statement...you would include your delete statement here). 

ccc333ab_4-1625719259910.png

The expression in the condition is: 

 

 

length(body('Get_items')?['value'])

 

 

 

 

View solution in original post

4 REPLIES 4
ccc333ab
Solution Sage
Solution Sage

Not sure if this was what you were asking, but this is what I think you are asking. 

 

1. Trigger your flow when a new item is created. 

2. Get all the items in your list filtered by the user that just created the item, but is NOT the same one that was just created (i.e., has the same id). 

 

ccc333ab_6-1625719510139.png

 

 

3. If any records are returned then you'll want to delete the items just created. However, if no records are returned, this is the first time this user has added an item and it'll do nothing. (Note, in my yes condition, I just have a compose statement...you would include your delete statement here). 

ccc333ab_4-1625719259910.png

The expression in the condition is: 

 

 

length(body('Get_items')?['value'])

 

 

 

 

lparkerMDVIP
Helper III
Helper III

@ccc333ab Thank you for responding! I don't quite understand how the last screenshot deletes the item. Wouldn't I need the Delete Item SharePoint action? When I used your expression, the condition returned False.

lparkerMDVIP
Helper III
Helper III

@ccc333ab Step 2 did return 1 item. So that part was successful.

lparkerMDVIP
Helper III
Helper III

@ccc333ab I was able to fix it!! I was using Created By Display Name instead of Created By Email in the Filter Query! What I did differently was, in the Yes section, added a delete item action for the recently created item. Thank you!!!!!!

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.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (1,939)