cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Powerapps & Sharepoint Online Query

Hi, I'm relatively new to powerapps & sharepoint so trying to learn fast. 

 

I know that with powerapps you can connect to sharepoint lists as a data source but I'm still not sure how this works.

 

I've opted for the default 'Helpdesk' type app in powerapps and on the login screen it has log in as a user and log in as an admin. How do I set within the app who is an admin and who is a general user. How do I define these so it recognises who is logged in? Do I need to make a list with generic users and admins and if so does the list have to be in a certain format for it to work? 

 

Note: I am using sharepoint online exclusively. No on-prem stuff. 

If this is the wrong place to ask please redirect me. 

 

Thanks!  

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @Anonymous,

 

Do you create your app using the "Help Desk" template app within PowerApps?

 

For your first question, within this template app, it has defined a Admin list (A collection, consists of emails), if the email of a login user is not existed within the Admin list (A collection), the user would be acted as a general user.

 

The AdminList is defined within the OnStart property of the first screen of this template app as below:

ClearCollect(TaskCategories,["LAPTOP / PC equipment issue","LAPTOP / PC software issue"]);
ClearCollect(TaskStatus,"NOT STARTED","IN PROGRESS","COMPLETED","DEFERRED","WAITING ON CSR");
ClearCollect(TaskPriority,"HIGH","MEDIUM","LOW");
Set(MyProfile,Office365Users.MyProfile());
/* The Admin List defined as below */ ClearCollect(AdminList,"MariaC@contoso.com","JimG@contoso.com","ScottK@contoso.com","NancyA@contoso.com","ThomasA@contoso.com","YvonneM@contoso.com"); ClearCollect(TicketList,{Id:1,Title:"Fix Mouse",Description:"That is my cat!!!",Category:"Laptop/PC equipment issue",PercentComplete:"0.9",Priority:"HIGH",AssignedTO:"THOMAS ANDERSEN",TaskStatus:"COMPLETED",Author:"ScottK@contoso.com",Editor:"Scott Konersmann",Created:"2/8/2018 3:29 PM",Modified:"2/5/2018 3:29 PM"},{Id:2,Title:"Replace keyboard", Description:"Please do it ASAP",Category:"Laptop/PC equipment issue",PercentComplete:"0.8",Priority:"LOW",AssignedTO:"YVONNE MCKAY",TaskStatus:"IN PROGRESS",Author:"PATRICK SANDS",Editor:"THOMAS ANDERSEN",Created:"2/5/2018 3:29 PM",Modified:"2/5/2018 3:29 PM"}); Set(NumberOfTickets,CountRows(TicketList))

16.JPG

 

For your second question, within this template app, it recognizes who is the current login user using the following formula (which is defined within the OnStart property of the first screen of this app😞

Set(MyProfile,Office365Users.MyProfile());

The MyProfile variable would return the current login user's profile. If you want to get the email of current login user, please use the following formula:

MyProfile.Mail

Note: If you want to get other properties of current login user, please reference the following formula:

MyProfile.PropertyName

In addition, if you want to use Office365Users.xxx() function, you must add a Office365Users connection within your app. More details about the Office365 Users connection, please check here.

 

For your third question, I think it is not necessary to create a Generic Users list and a Admins list. You only need to create a single list -- Admins List. If the email of current login user is not existed within the Admins List, it would be acted as general user.

 

You could consider take a try to add a Admins List within your SP list as below:17.JPG

 

And then add this SP list as a data source within your app. Modify the AdminList formula (Within the OnStart property of the first screen of this app) as below:

ClearCollect(AdminList,'20180827_Case12_AdminsList'.Email);

 

Best records,

Kris

 

 

Community Support Team _ Kris Dai
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

2 REPLIES 2
v-xida-msft
Community Support
Community Support

Hi @Anonymous,

 

Do you create your app using the "Help Desk" template app within PowerApps?

 

For your first question, within this template app, it has defined a Admin list (A collection, consists of emails), if the email of a login user is not existed within the Admin list (A collection), the user would be acted as a general user.

 

The AdminList is defined within the OnStart property of the first screen of this template app as below:

ClearCollect(TaskCategories,["LAPTOP / PC equipment issue","LAPTOP / PC software issue"]);
ClearCollect(TaskStatus,"NOT STARTED","IN PROGRESS","COMPLETED","DEFERRED","WAITING ON CSR");
ClearCollect(TaskPriority,"HIGH","MEDIUM","LOW");
Set(MyProfile,Office365Users.MyProfile());
/* The Admin List defined as below */ ClearCollect(AdminList,"MariaC@contoso.com","JimG@contoso.com","ScottK@contoso.com","NancyA@contoso.com","ThomasA@contoso.com","YvonneM@contoso.com"); ClearCollect(TicketList,{Id:1,Title:"Fix Mouse",Description:"That is my cat!!!",Category:"Laptop/PC equipment issue",PercentComplete:"0.9",Priority:"HIGH",AssignedTO:"THOMAS ANDERSEN",TaskStatus:"COMPLETED",Author:"ScottK@contoso.com",Editor:"Scott Konersmann",Created:"2/8/2018 3:29 PM",Modified:"2/5/2018 3:29 PM"},{Id:2,Title:"Replace keyboard", Description:"Please do it ASAP",Category:"Laptop/PC equipment issue",PercentComplete:"0.8",Priority:"LOW",AssignedTO:"YVONNE MCKAY",TaskStatus:"IN PROGRESS",Author:"PATRICK SANDS",Editor:"THOMAS ANDERSEN",Created:"2/5/2018 3:29 PM",Modified:"2/5/2018 3:29 PM"}); Set(NumberOfTickets,CountRows(TicketList))

16.JPG

 

For your second question, within this template app, it recognizes who is the current login user using the following formula (which is defined within the OnStart property of the first screen of this app😞

Set(MyProfile,Office365Users.MyProfile());

The MyProfile variable would return the current login user's profile. If you want to get the email of current login user, please use the following formula:

MyProfile.Mail

Note: If you want to get other properties of current login user, please reference the following formula:

MyProfile.PropertyName

In addition, if you want to use Office365Users.xxx() function, you must add a Office365Users connection within your app. More details about the Office365 Users connection, please check here.

 

For your third question, I think it is not necessary to create a Generic Users list and a Admins list. You only need to create a single list -- Admins List. If the email of current login user is not existed within the Admins List, it would be acted as general user.

 

You could consider take a try to add a Admins List within your SP list as below:17.JPG

 

And then add this SP list as a data source within your app. Modify the AdminList formula (Within the OnStart property of the first screen of this app) as below:

ClearCollect(AdminList,'20180827_Case12_AdminsList'.Email);

 

Best records,

Kris

 

 

Community Support Team _ Kris Dai
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

Anonymous
Not applicable

Thanks!

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 (52,859)