web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / powerapps VAR creation
Power Apps
Answered

powerapps VAR creation

(0) ShareShare
ReportReport
Posted on by 21

Hi Guys,

 

so this is what I want to achieve

we have a setting button that is visible for us who are in the admin list and then you have that one with everything

what I want to have know is that a PO can only see the setting button on the Product he owns and I want to do that with a List on sharepoint and a VAR on powerapps.

 

this is what I have currently 

I've created the list on sharepoint with 2 required fields

a name and a service field that is a lookup from another list

 

this is what I currently have 

Set(VarSO, If(User(). in 'SO Groups'.Name, true,false));
 
SO Groups is the name of the list on sharepoint I'm not sure have I can fill in the name column in here because the rest I can figure out myself but what I need to fill in at this point If(User().???? is a riddle for me
 
 

 

 

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @Nathan5 

    Please consider changing your Formula to the following:

    Set(VarSO, LookUp('SO Groups', Name = User().FullName, true))

    This will be either true or false based on finding any record where the user name is in your Name column.

     

    I hope this is helpful for you. 

  • Nathan5 Profile Picture
    21 on at

    @RandyHayes 

     

    I'm getting an invalid argument type on the = in the code

     

    already thank you for helping me with this struggle

  • ArminSimon Profile Picture
    113 on at

    What kind if field 'name' is referring to? Text (should work) or record?

     

    Please click Accept as Solution so that others may find it more quickly if this post solve your problem.
    If you liked my response, please give it a Thumbs Up.

  • Nathan5 Profile Picture
    21 on at

    The field 'name' is a person or group as this is linked to AD where all the users are in

  • ArminSimon Profile Picture
    113 on at

    Therefore you need to point to FullName in the above example as well:

    Set(VarSO, LookUp('SO Groups', Name.FullName = User().FullName, true))

     

    Please consider to use 'Email' rather than 'FullName' in this syntax, since 'Email' obviously is unique but 'FullName' may not.

     

    Please click Accept as Solution so that others may find it more quickly if this post solve your problem.
    If you liked my response, please give it a Thumbs Up.

  • Nathan5 Profile Picture
    21 on at

    that worked out changed it to email.

    so thank you for that know i'm running in to the next problem and that is if I click on visible and add the VAR in there then it shows it with every settings button and not just the one I added  the service to in the sharepoint list

    below Screenshot is from the sharepoint list and the one below that is his view in the app but it only needs to show with one or more if i added him in sharepoint to that service too

    Nathan5_0-1614264088217.png

    Nathan5_1-1614264155082.png

     

     

  • ArminSimon Profile Picture
    113 on at

    Good to hear that it is working...

    About your second problem: I do not get your point here. Which 'visible' click do you mean. Please keep in mind, that we are not as deep in your app as you are.

     

    Please click Accept as Solution so that others may find it more quickly if this post solve your problem.
    If you liked my response, please give it a Thumbs Up.

  • Nathan5 Profile Picture
    21 on at

    ow yeah sorry about that.

    I'll give an example with user 1 and user 2

    user 1 is an admin and sees every config/settings button

    user 2 is in the SO group and only needs to see the one that is assigned to him in the SO list so for example MS Teams or Test service

     

    what is happening now is when I add the VARSO to the visible user2 also sees everything and he only needs to see the settings button for MS Teams or Test service

     

    hope this makes it more clear I think I need to work with IF statement in visible but not sure why it's not working

  • Verified answer
    ArminSimon Profile Picture
    113 on at

    I made those decisions right at the start of the app (OnStart) where I check if the logged in user (mentioned in the thread above) is member of that group and set a global variable (like 'varUserIsDataManager') to true or false accordingly. This variable is the base of the 'visibility' property of the icon or whatever.

     

    as an example:

     

    ClearCollect(varMembersfromSG,Office365Groups.ListGroupMembers("<GUID of the group>").value);
    Set(
     varLoginUser,
     User()
    );
    If(!IsBlank(LookUp(varMembersfromSG,mail=varLoginUser.Email)),
     Set(
     varUserIsDataManager,true
     ),
     Set(
     varUserIsDataManager,false
     )
    );

     

    In this example, I use the 'Office 365 Groups' connector to access the groups and their members.

    (see: https://docs.microsoft.com/en-us/connectors/office365groups)

     

    Please click Accept as Solution so that others may find it more quickly if this post solve your problem.
    If you liked my response, please give it a Thumbs Up.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard