Hi,
I have created an App and want deny access for some Azure user groups.
In the 'App - On Start' I pasted the following code:
Set(varUser, Office365Users.MyProfileV2().mail);
Set(isUserMemberTeamInc,varUser in Office365Groups.ListGroupMembers("d9add382-9c50-4231-957e-3566c6b1241e").value.mail);
However when open a form and paste underneath a 'button - visible' this code:
Not(Parent.Printing) || isUserMemberTeamInc
Because the user is not a member of 'isUserMemberTeamInc' the button should not be visible.
Please inform me why the variable is not responding.
Kind regards,
Jan
Netherlands
Solved! Go to Solution.
The issue continued due to different usergroups pointing to the same 'VarUser'
I changed this by creating for each usergroup 'VarUser'.
Now all is working accept the combination with hiding the print the button when start printing.
But as workaround using the disable option is accpetable.
Thnx again for all the help!
There are two potential issues here.
1) In is not a delegable function and ListGroupMembers only returns a maximum of 1,000 users. So if its a really large group you search may not work.
2) Rather than trying to get the email from the profile I would use the following.
Set(varUser, User().Email);
I tested and this works if the group is an O365Group, not just a security or SharePoint group. Also, not sure what the Parent.Printing might resolve to in your app. Since its Or that will override the group membership for removing the button.
Sory but this does not work either
When the statement is not used in a variable it gives data in return.
error:
You'll get that error until you run OnStart the first time because there is no variable yet. But, It works for me. Here's the OnStart
Set(varUser, User().Email);
Set(isUserMemberTeamInc,varUser in Office365Groups.ListGroupMembers("6c2b508e-b774-44ca-859c-de8ce7be96b4").value.mail);
Here's the Visible and DisplayMode for two buttons. DisplayMode is easier to see..
isUserMemberTeamInc
If(isUserMemberTeamInc,DisplayMode.Edit,DisplayMode.Disabled)
And here is what it looks like if I'm not a member of the group.
Logged in as E1test who is not a member of the group. The one button is invisible and the other is disabled.
OK it seems the variable is recognized and the I can not use the icon instead.
But is it possible to combine the Not(Parent.Printing) with making the button hidden for none isUserMemberTeamInc
users?
thnx
Jan
Oeps!
It seems the button is now all time disabled no matter what user account logs in.
I double checked the GroupID's and they are correctly configured.
Really strange this working on your end.
Sincerely,
Jan
1) Is it an Office 365 group? That is the only kind of group that the connector will work with.
2) Try removing the Not(parent.printing). Not(parent.printing) is always true unless you are currently printing the screen. Since you are using an 'or' it will always be true. If you remove it temporarily you can verify that the variable works before trying to add printing in. Do you want the button to disappear when printing or appear?
The issue continued due to different usergroups pointing to the same 'VarUser'
I changed this by creating for each usergroup 'VarUser'.
Now all is working accept the combination with hiding the print the button when start printing.
But as workaround using the disable option is accpetable.
Thnx again for all the help!
User | Count |
---|---|
126 | |
87 | |
85 | |
75 | |
69 |
User | Count |
---|---|
215 | |
180 | |
139 | |
97 | |
83 |