PowerApps as a Front End

There are two different ways that you can create PowerApps canvas apps.  There are customized SharePoint list forms, and there are standalone PowerApps.  I always prefer standalone, and I wrote a post that is a full comparison between the two types, PowerApps Standalone App Versus Customized List Form.  Whenever I’m talking about the fact that I prefer standalone over customized list forms, someone always asks… “What about when end users go to the list?”.  When we create a standalone app as the front end interface to the list, we want to prevent people from directly accessing the SharePoint list.  There are several different techniques that you can use, to accomplish this, to ensure that any time someone is adding or editing items in the list, it is only from the PowerApp.  This isn’t a step-by-step list of actions to take, this is a list of suggestions and how to accomplish different ways of locking down the list.  The reason this is so tricky, is that in order for people to be able to add and edit items in the list, they need to have at least “Contribute” permission to it, but then they can see the list when they view all site contents of the site it’s in, and they can find it via search.  Maybe Microsoft will provide some other way to accomplish this soon, but as of now, these are some options.
Check out my Advanced PowerApps Course

  • Create a redirect button in the existing list items.  First you’ll need the web url to your standalone PowerApp.  Go to web.powerapps.com, select your app’s drop-down, and click on the Details screen.  That’s where you’ll find its Web link.  Go to your SharePoint list, and although you haven’t customized the list form, go ahead and click to customize the list form with PowerApps. Delete the form control, and add a big button.  For the button’s OnSelect property, use the Launch function, to take them to your standalone app.  That’s the web link I was talking about.  Save and publish this app.  With this method, if people end up on the list, and try to create a new item or edit an item from there, they’ll only get this big button to take them to the correct app.

customize-travel-form

  • Disable Quick Edit (datasheet view).  Go to your list’s settings, click advanced settings, and for the setting called Quick property editing, change it to NO.  This way, no one can directly edit the list right on the page.

quick-property-editing-pa

  • Show them nothing.  If you don’t want any items to show when people go to the list, filter it.  Go to your list’s all items view settings, and filter so that ID is equal to zero.  That way, nothing will ever show.  Delete all other views.

id-equal-to-zero

If you use this method, you’re going to want to prevent people from creating more views, too.  To prevent people from creating views, you’ll have to create a custom permission level.

permission-levels-sp

Create a permission level by copying an existing permission level.  Copy the contribute permission level, and call your new level something else, like “contribute not create views”.  The important thing to uncheck, is Manage personal views.  You can even uncheck “create alerts” if you want to prevent them from creating SharePoint alerts for themselves.

personal-permissions

Note that I’m only telling you to create this permission level for use on this one list.  This is not something that needs to be applied at the whole site level.  Go to  your list settings, and click Permissions for this list. At the top, click Stop inheriting permissions.  Check the box next to the group of people who you want to be able to add and edit items in this list, and change their permission level to the one you just created.

contribute-not-create-views

  • With the options that I’ve told you so far, users will still be able to find your list and items via search in SharePoint, and when they click on an item in the search results, and open it, they will be taken to that lovely giant button that will take them to the standalone app.
    If you’d like to prevent people from finding your list via search, you can go to the list’s advanced settings, and set Allow items from this list to appear in search results to NO.

hide-from-search-sp

  • What if you DO want people to be able to go to your list in SharePoint, but when they click an item, you want it to take them to that item in your standalone app?  April Dunham wrote a genius post about that, called Open PowerApp using SharePoint Column Formatting, where she teaches you how to use the Param function to pass an ID parameter to the item, and also create a custom hyperlink on each list item that will open that item in the Standalone app!  I took that example, and made my own version of it, as view formatting (click all items and choose format current view) instead of column formatting.  It only shows the title, as a hyperlink, and none of the column headers or out of box drop-downs and options.  The part in blue in the code there, is where you put the full web link to your app, after you’ve followed April’s post and created a parameter in your app.

{
“schema”: “https: //developer.microsoft.com/json-schemas/sp/view-formatting.schema.json”,
“hideSelection”: true,
“hideColumnHeader”: true,
“rowFormatter”: {
“elmType”: “div”,
“attributes”: {
“class”: “sp-row-card”
},
“children”: [
{
“elmType”: “a”,
“txtContent”: “[$Title]”,
“attributes”: {
“target”: “_blank”,
“href”: “=’appweblink?ID=’+[$ID]”
}
}
]
}

}

Here’s what it looks like:

simple-travel-requests

There is also a PowerShell method that Pieter Veenstra mentions in this post, that you can use when you’re creating the list.

Where did I figure out how to customize the view like that?  I’m not a dev!  Here’s a long list of code samples, of different ways of displaying views:

https://github.com/SharePoint/sp-dev-list-formatting/tree/master/view-samples

8 comments

  • Hi Laura,

    I have watched a large number of your Power Hours and combined with those of your collegue Shane Young have obtained a reasonable grasp of this wonderful system.

    Your “Quick Parts” Word file solution was just missing one thing (PDF), which you have now provided the solution that allows emailing of completed forms in PDF without subscribing to the new (and expensive for a large organisation) Premium connector.

    A couple of things I have done along the line of your post (allow users to see only what you want them to) may be either incorrect or useful. I have users with a PowerApps-only interface to a SharePoint list – they are external contractors and I want them to see only their work. Easy enough in PowerApps – controlled by their login. In SharePoint, I have stopped inheriting permissions on the home (and only) page for the site and removed the contractors – that way they cannot browse to the data, even if they work out the address.

    A second item (which I am sure you know but may be useful to your group) is that stand-alone PowerApp screens can be easily copied and pasted into SharePoint edit screens. Just some changes to the Item property (SharePointIntegration.Selected) and the SharePointIntegration View, New and Edit properties and they all work fine. I have a number of fully-functional multi-screen PowerApps running on SharePoint New/Edit/View screens.

    I look forward to your posts.

    Warren Belz
    Ventia Pty Ltd
    Australia

    Like

  • Worth mentioning that disabling search indexing also means higher level compliance features like eDiscovery are impacted (broken). Check with tenant admins before going down that path.

    Like

  • Hi Laura,
    That’s a very good blog, but how can we prevent user from editing form on SharePoint on their mobiles, as they still can edit using SPO form. I’m not sure if this is updated already or not. Hopefully it can blocked. Alternatively Is there a way to prevent my tenant users from using SP Mobile App?

    Like

  • I second the comment on the mobile app. That has bitten me before. The app ignores default views.

    Like

  • Hi Laura,

    You know what I do?
    OnNew property I add the Launch action and RequestHide() action like below:

    Launch(“https://apps.powerapps.com/play/9c3cc2aa-xxxx-yyyy-b987-4bbd674196c0?tenantId=f35a6974-tttt-eeee-aaaa-ff31d7dc53a5”);
    RequestHide();

    So, when they click on New Item, will automatically Launch the PowerApp and Close the actual one

    Like

  • Pingback: PowerApps Community Call 9/18 | @WonderLaura

Leave a reply or question

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.