I have a gallery that displays items from a sharepoint list, there is button on each gallery item which opens a new form for the user to create an item in a different list. How do i disable or hide that item in gallery for that particular user when a new item is created based off it. The item should be disabled or hidden everytime the app is accessed by that user.
It looks like you want everyone other than the user who created a new item in a second list to see everyone elses items. If that is so, go into SharePoint, add a column to your list called NewItem and with the Column Type "Yes/No". Set the default to "No". In the OnSuccess property of your new form add the following
Where YourSharepointlist is the list in the Items property of the gallery and Gallery1 is the name of the gallery with the button.
Filter the Items property of the Gallery for the logged in user with User(). and for items that have already been added to the second list as follows: (You will get a delegation warning but you can ignore it if your list is <2000 items.)
Filter(YourSharepointList,User().FullName <> 'Modified By'.DisplayName && NewItem=true)
Your gallery should only show the Item if a user other than the one who modified the item is looking at the list. If you put a toggle in the gallery with the Default property of NewItem. It will show that a item has been added to the new list. You could also hide the button if the item has already been added to the new list by someone else if you set the Visible property of the button to !NewItem.
I may be misunderstanding your requirements. If you want the item in the gallery to be invisible to everyone once a new item is added to a second list, the Filters would be different.
Thanks for the quick reply. Sorry for not posting the question clearly. In the second list I want only the user to see and edit his item so I will be suing the sharepoint default read and create-edit access option. I will need that item level permission as I want to enable the user to view and edit only his item in a edit form on a different screen. Also, the list may contain more than 2000 items and I want to avoid delegation error by making sharepoint do the filter rather than me using filter option in powerapps.
Once a user creates a new item in second list, the item in gallery should be invisible to this particular user as other users will be creating new items based on the gallery item.
Did you mean that you want the user to be able to edit the record when first time loading the app, but disable editing when user finish updating one record? If so, then you could set below formulas for this app:
Button1(Submit Button for the Edit Form).OnSelect=SubmitForm(EditForm1);Set(V,false)
Thanks for the reply, I want the gallery to be in edit mode even after the user create/updates one record. Below image shows the gallery, user clicks on create next to first item and a new form opens to create a record in a different list. After submitting the form, user comes back to gallery and I want the first item in the gallery to be hidden or dsiabled to this particular user.
Check out new user group experience and if you are a leader please create your group
We are excited to announce that Demo Extravaganza for 2021 has started!
On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks
Don't miss the call this month on June 16th - 8a PDT