cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
pnass001
Post Patron
Post Patron

Two Galleries. One for Users to view their own submissions. One for Moderator to view and edit all.

I have the gallery circled in green as the gallery which users can see their own submission and no one else's. The gallery circled in the orange is for the Moderator and will be secured within a locked button. For this gallery, since I am the moderator, I would like the ability to edit all forms. How can I do this? 

 

Currently, the submissions are popping up within the gallery but I I cannot click on any submissions to be able to edit them. If I click on a submission the fields do not populate with the respective data.

 

Orange gallery code (fields populate with this gallery if I click on the submission):

 

Items:

Filter(
'Standards Selection Form Data Collection',
'Creator Email' = varUser.Email)

 

Green gallery code

 

Items:

Filter(
'Standards Selection Form Data Collection',
StartsWith(
'Standard Endorser',
FilterTextBox.Text
) ||
StartsWith(
Department,
FilterTextBox.Text
)
)

 

FilterTextBox is the search box to the left of the green gallery. This is so I can filter for the respective submission I would like to edit. 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @pnass001 ,

Do you want the edit form could both work for gallery4 and gallery6?

If so, you need to use an if statement to justify whether it display gallery4.selected or gallery6.selected.

Try this:
1)set gallery4's OnSelect: 

Set(var,"moderator")

2)set gallery6's OnSelect:

Set(var,"notmoderator")

 3)set the edit form's Item:

If(var="moderator",Gallery4.Selected,Gallery6.Selected)

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
v-yutliu-msft
Community Support
Community Support

Hi @pnass001 ,

Do you want common user could only view their own submission, Moderator could view and edit all the submission?

Could you tell me

1)what your data source is?

2)how do you distinguish the current user's identity?

I assume that your data source is sharepoint. 

I suggest you create two sharepoint lists, one for submission, one for user.

In user list, you could have these fields: user field(person type), identity field( text type).

 

I've made a similar test for your reference:

1)set the app's OnStart:

Set(varidentity,LookUp(userlist,User().Email=user.Email,identity))

//get current user's identity

2)set the green gallery's Visible:

varidentity="common user"

set the green gallery's Items:

Filter(submissionlist,'Created By'.Email=User().Email)

//current user could only view his own submission

3)set the orange gallery's Items:

submissionlist

set the orange gallery's Visible:

 

varidentity="Moderator"

 

//only when current user is Moderator, he could view this gallery

4)set the edit form's data source:

submissionlist

set the edit form's Item:

orangegallery.Selected

set the edit form's Visible:

varidentity="Moderator"

 //only when current user is Moderator, he could view this edit form

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-yutliu-msft Hi there, I would like the user to view ALL their submissions from the past, including their most recent. And I would like the moderator to view all submissions that have been done with the powerapp.

 

Datasource is a Sharepoint list. And the user identify is distinguished by email.

 

By creating two Sharepoint listing? I would have to create a mirror listing to my original one? I can't just connect two galleries to one datasource?  

Hi @pnass001 ,

Do you want only one list?

Yes, this is possible.

Then you need to make the list include not only the data of permissions , but also the data of user identity.

I suggest you insert these fields:

submission field(text type),  user identity field( text type)

 

1)set the app's OnStart:

Set(varidentity,LookUp(submissionlist,'Created By'.Email=User().Email,identity))

//get current user's identity

2)set the green gallery's Visible:

varidentity="common user"

set the green gallery's Items:

Filter(submissionlist,'Created By'.Email=User().Email)

//current user could only view his own submission

3)set the orange gallery's Items:

submissionlist

set the orange gallery's Visible:

varidentity="Moderator"

//only when current user is Moderator, he could view this gallery

4)set the edit form's data source:

submissionlist

set the edit form's Item:

orangegallery.Selected

set the edit form's Visible:

varidentity="Moderator"

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yutliu-msft ,

 

I am able to filter both listings appropriately to the respective user/ moderator.

 

The issue is with the moderator's gallery, when I select a submission to edit, the submission isn't populating the fields.


Compared to the user's library, if I click a submission to edit, the fields become populated. 

 

I want both galleries to be able to populate the fields if submissions are selected and this isn't happening for the moderator's gallery. that is the issue. 

 

Thank you in advance Phoebe!

@v-yutliu-msft Or how can I have two gallerys within the Item code of "Form2" which is my form name?

 

Currently its Gallery6.Selected  and I would like both forms to be within the Item code as I think this will solve the issue.

This code doesn't work but to give an idea of what I am looking for ->Gallery6;  Gallery4.Selected

 

 

Gallery4 would be the moderator gallery

 

Hi @pnass001 ,

Do you want the edit form could both work for gallery4 and gallery6?

If so, you need to use an if statement to justify whether it display gallery4.selected or gallery6.selected.

Try this:
1)set gallery4's OnSelect: 

Set(var,"moderator")

2)set gallery6's OnSelect:

Set(var,"notmoderator")

 3)set the edit form's Item:

If(var="moderator",Gallery4.Selected,Gallery6.Selected)

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

@v-yutliu-msft  it works 🙂 merci

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (68,501)