Hi Power Apps Community,
I am creating an app which is filtering the data in the Gallery against that user who is logged in.
I would like the users to add items to the SharePoint list - which is currently working, however they should be restricted into only being allowed to add a particular item once. Is this possible in Power Apps?
I would really appreciate any assistance.
Thank you in advance.
Solved! Go to Solution.
Hi @Data_Enthusiast ,
I think that the easiest way to achieve your goal is to put a condition with the Patch function on one of the brach.
So put on OnSelect property something ruled by this logic:
If (newItemValue in Concat(YourList,ItemColumn),
Notify("The Item is already in the list"),
Patch(....)
)
HI @Data_Enthusiast ,
As a different approach, try this on the save button DisplayMode - assuming you have selected the item from a gallery.
If(
LookUp(
YourListName,
ID = YourGalleryName.Selected.ID
).'Modified By'.DisplayName = User().FullName,
DisplayMode.Disabled,
DisplayMode.Edit
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Sure, but define "particular item". What defines particular item - perhaps, Title column or some other column with specific value. If so, one option is to call a flow on submit button that checks whether an item already exists for the passed value/s and return true/false. If item exists is true, display message to the end user otherwise continue with item creation from Power Apps. Add details if this I completely misunderstood your question 🙂
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Thanks
Hi @Data_Enthusiast ,
This issue is whether the user is the only one likely to edit the record. If so, you could check the user's name against the modified property and if the same, they have obviously been there. If multiple users, then you could store concatenate the email of everyone who saves to a multi-line text field and then check for the existence of the logged-in user.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Hi @Data_Enthusiast ,
I think that the easiest way to achieve your goal is to put a condition with the Patch function on one of the brach.
So put on OnSelect property something ruled by this logic:
If (newItemValue in Concat(YourList,ItemColumn),
Notify("The Item is already in the list"),
Patch(....)
)
Interesting, I did not consider using a Flow. I think I used 'particular' loosely. It is a column which is a lookup to a list of items.
The item will only be edited by one person. How would I check against the modified property?
Hi @gabibalaban
I ran into an error using this approach:
The fields are within a Form. 'Datacardvalue.selecteditems.value' - the error is highlighted on the '.value' part.
I'm a little bit confused, The selecteditems property returns all items selected from a combobox control /list box (controls that allow to select multiple items)...Are you trying to update multiple Items ? If not, please use Datacardvalue.selected.value instead.
HI @Data_Enthusiast ,
As a different approach, try this on the save button DisplayMode - assuming you have selected the item from a gallery.
If(
LookUp(
YourListName,
ID = YourGalleryName.Selected.ID
).'Modified By'.DisplayName = User().FullName,
DisplayMode.Disabled,
DisplayMode.Edit
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
207 | |
70 | |
57 | |
51 | |
17 |
User | Count |
---|---|
261 | |
130 | |
86 | |
86 | |
68 |