cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Elitezone
Post Prodigy
Post Prodigy

Admin section based on sharepoint list

Hello,

 

Today I thought about idea to make a sharepoint list with one column (People) that would contain a list of app admins.

I added this sharepoint list, and created a button that would provide access to admin functions, but it does not work (added this function to property Visible).

 

 

 

!IsBlank(LookUp('ADMIN_LIST_SP','ADMIN_FULLDATA'.Email=User(Email)))

 

 

Invalid argument type, invalid number of argument expected 0 got 1

ADMIN_LIST_SP= sharepoint list

ADMIN_FULLDATA = sharepoint column people type

 

I also tried this:

 

User().Email in ADMIN_LIST_SP.'ADMIN_FULLDATA'

But this shows that data cannot be converted from Text to record.

 

Is this good idea to make such a validation on Visible of buttons? 

And how can I fix that?

1 ACCEPTED SOLUTION

Accepted Solutions

@Elitezone probably you can try this way...

 

On AppStart - Set(crntUserEmail,User().Email).

 

OnVisible (of respective screen) - Set(varAdmin,false);If(!IsBlank(LookUp(ADMIN_LIST_SP,ADMIN_FULLDATA.EmailAddress=crntUserEmail)),Set(varAdmin,true),Set(varAdmin,false))

 

View solution in original post

3 REPLIES 3
ham
Microsoft
Microsoft

Hello,

 

I would suggest you validate on OnSelect, any specific reason why you are doing this on Visible?

 

Also are you look for the emails ids stored in the sharepoint list column?

 

Best Regards,

Harish M

Please mark as verified if the answer is helpful. 

@ham 

I was thinking about something like that:

When you are on a Sharepoint List (your e-mail in people type field) you can see a toggle - admin context.

This toogle is by default off and I can use app as a normal user - but when I click this toggle, and make it ON then my admin context make my screen different (I can see more data, and I can delete data that normally I wouldn't be able to - I will make a variable for that on this toggle and make buttons Visible depending on that variable data). I think that this will work, and be quiet logical.

Normal users don't see a toggle so they cannot switch a context on.

 

My list that I provided have people field and I want to read from it e-mail to allow admin access.

@Elitezone probably you can try this way...

 

On AppStart - Set(crntUserEmail,User().Email).

 

OnVisible (of respective screen) - Set(varAdmin,false);If(!IsBlank(LookUp(ADMIN_LIST_SP,ADMIN_FULLDATA.EmailAddress=crntUserEmail)),Set(varAdmin,true),Set(varAdmin,false))

 

View solution in original post

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

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

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 (58,796)