cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Oskarkuus
Level: Powered On

Permission control not working, cant see what i am doing wrong

I have this code on my ONSTART

screenshot: http://prntscr.com/nok0al

ClearCollect(collAppUsers5;'Office365-grupper'.ListGroupMembers("7b606cec-bb50-438a-a262-89269ca0eb73").value);;Set(Button1Mode;CountRows(Filter(collAppUsers5;Lower(mail) =Lower( User().Email))) = 1);;

ClearCollect(collAppUsers6;'Office365-grupper'.ListGroupMembers("2ec581ed-429b-4e8e-878a-6ce10ff32b58").value);;Set(Button2Mode;CountRows(Filter(collAppUsers6;Lower(mail) =Lower( User().Email))) = 1);;

ClearCollect(collAppUsers7;'Office365-grupper'.ListGroupMembers("1749g410-e704-45f4-8507-36g6b00e68a9").value);;Set(Button3Mode;CountRows(Filter(collAppUsers7;Lower(mail) =Lower( User().Email))) = 1)

Then i have this on DisplayMode for a button.

If(Button1Mode;DisplayMode.Edit;DisplayMode.Disabled)

If(Button2Mode;DisplayMode.Edit;DisplayMode.Disabled)

If(Button3Mode;DisplayMode.Edit;DisplayMode.Disabled)

Ofc just one line per button, so in total i have 3 buttons.

 

Button1 and Button3 works fine.

My account is member of the gorup with the above ID for Button2.

But still the DisplayMode does not change.

It do change for all other buttons... but not this one. I have tried leaving the group and rejoining.. Still nothing.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Permission control not working, cant see what i am doing wrong

@Oskarkuus 

First...there is data in it...that's a good thing.

Now, if you're looking at the View->Collections area, then yes, it is limited to 5.  I sent you there as a quick check to make sure that you are actually gathering daa in the collection...which you are.

 

So, now, I would do that next piece from before - create a Gallery and set the Items to the collection.  Then throw a label in the Gallery and set the Text to ThisItem.mail

See if you see yourself in there - or at least you see things you expect.

_____________________________________________________________________________________
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

10 REPLIES 10
Super User
Super User

Re: Permission control not working, cant see what i am doing wrong

@Oskarkuus 

Put a Label on the screen and set the Text property to:   

CountRows(Filter(collAppUsers6;Lower(mail) =Lower(User().Email)))

See what that displays.

_____________________________________________________________________________________
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.
Oskarkuus
Level: Powered On

Re: Permission control not working, cant see what i am doing wrong

i get zero (0) as a result.

 

That seems wrong.

Why?

EDIT:
I did the same for all others, added a label and all other show 1. This one show 0

 

Super User
Super User

Re: Permission control not working, cant see what i am doing wrong

@Oskarkuus 

Yes, that would be a problem if you are in that group as you suspect.

The next thing would be to look at the collection (collAppUsers6) in the View->Collections area and see that you are getting results from that formula in the collection.

If it is empty, then I suspect there is an issue with the GroupID.

If it has values and you are not in it, then I suspect either a lag in the group members list being updated on the Office 365 side or some other factor.

_____________________________________________________________________________________
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.
Oskarkuus
Level: Powered On

Re: Permission control not working, cant see what i am doing wrong

I created a gallery and put this in the gallerys ITEMS

'Office365-grupper'.ListOwnedGroups()

 

I get no results atall.

In the gallery i have one textfield with this:

ThisItem.ID

 

This used to work before, but now i get error that ID is not valid.

So i cant even get a list of my accounts groups.

 

Also tried this in the gallery items
'Office365-grupper'.ListGroupMembers("GROUP-ID-NUMBER")

Same issue as above, no reults and ID is not valid o.O

 

Could this be Microsoft doing something?

 

Oskarkuus
Level: Powered On

Re: Permission control not working, cant see what i am doing wrong

Logged in with one other account.

 

One account all but 1 buttns work.

One account none of the buttons work.

 

Both accounts have the same group memberships and should see exactly the same.

 

Something is not right.

Super User
Super User

Re: Permission control not working, cant see what i am doing wrong

@Oskarkuus 

The ListOwnedGroups function will return a table that has a Value column.  In that Value column is the table of all the groups.

So, change your Gallery Items to the following formula:

'Office365-grupper'.ListOwnedGroups().value

Now you will have all of the group rows in the Gallery and ThisItem.id will be valid.

 

The same goes for your ListGroupMembers function.  It will return a table with a value column.  The first record value column is what you want.

 

You can test all of this with two galleries (Gallery1 and Gallery2)

Items for Gallery1 - 'Office365-grupper'.ListOwnedGroups().value

A label in the Gallery.  Set text to : ThisItem.id

 

Items for Gallery2 - 'Office365-grupper'.ListGroupMembers(Gallery1.Selected.id).value

A Label in Gallery2.  Set test to : ThisItem.displayName

 

You will now see all groups you own and all members in those groups as you select them.

 

_____________________________________________________________________________________
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.
Super User
Super User

Re: Permission control not working, cant see what i am doing wrong

@Oskarkuus 

So the question still remains I asked earlier, what are you getting in those collections?

If you don't view them through the collection viewer, then at least set them as the items property of a gallery and see what is going on in them.

_____________________________________________________________________________________
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.
Oskarkuus
Level: Powered On

Re: Permission control not working, cant see what i am doing wrong

I only see 5 rows of members/data in my collection.

The group have over 30 members....

 

So it seems i only get 5 ?!

Super User
Super User

Re: Permission control not working, cant see what i am doing wrong

@Oskarkuus 

First...there is data in it...that's a good thing.

Now, if you're looking at the View->Collections area, then yes, it is limited to 5.  I sent you there as a quick check to make sure that you are actually gathering daa in the collection...which you are.

 

So, now, I would do that next piece from before - create a Gallery and set the Items to the collection.  Then throw a label in the Gallery and set the Text to ThisItem.mail

See if you see yourself in there - or at least you see things you expect.

_____________________________________________________________________________________
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

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,909)