I've been working on a PowerApp which uses SharePoint Lists to store its data. When I manually create the lists within SharePoint, I can see these when adding the Data Source in PowerApps - however, as this app is intended to be deployable by end-users, and each deployment will use data from a different site, I need to automate provisioning of the lists.
This is where the issue arises - I'm using the asset provisioning features of SharePoint Framework to deploy the lists into a SharePoint site. Effectively, the user installs a SharePoint App, and the App creates the lists. Once that's done, the user will deploy the PowerApp Template and go and hook up the data sources to the new lists. Still not ideal, but better than asking the user to create the lists themselves (and expecting them to get all the list and column names and types just right).
The problem is that PowerApps doesn't show these new lists when adding the data source.
These are my lists as shown in the Site Contents of the SharePoint site:
When adding a data source in PowerApps:
Here is an example of how the lists are defined within the SPFx app:
TicketCategoriesElements.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Field ID="{0c955283-e025-4e89-aeb9-760cda26f7a3}"
Type="Text"
Name="CategoryName"
DisplayName="Category"
Description="Category"
Required="FALSE"
MaxLength="100"
Group="Service Desk Power App" />
<ContentType ID="0x0100311831B2631E44E5B5119247C6C44BA7"
Name="TicketCategory"
Group="Service Desk Power App"
Description="Defines a Ticket Category.">
<FieldRefs>
<FieldRef ID="{0c955283-e025-4e89-aeb9-760cda26f7a3}" />
<FieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Name="Title" Required="FALSE" Hidden="TRUE" />
</FieldRefs>
</ContentType>
<ListInstance CustomSchema="TicketCategoriesSchema.xml"
Title="Ticket Categories"
Description="List of Ticket Categories."
Url="Lists/Ticket Categories"
Hidden="FALSE"
FeatureId="{00bfea71-de22-43b2-a848-c05709900100}"
TemplateType="100">
</ListInstance>
</Elements>
TicketCategoriesSchema.xml:
<List xmlns:ows="Microsoft SharePoint"
Title="Ticket Categories List"
Url="Lists/Ticket Categories List"
EnableContentTypes="TRUE" DisableAttachments="TRUE" FolderCreation="FALSE" DisableGridEditing="TRUE" NoCrawl="TRUE" NavigateForFormsPages="TRUE" VersioningEnabled="TRUE" MajorVersionLimit="50" MajorWithMinorVersionsLimit="0" Experience="New" Direction="$Resources:Direction;" BaseType="0" xmlns="http://schemas.microsoft.com/sharepoint/">
<MetaData>
<ContentTypes>
<ContentTypeRef ID="0x0100311831B2631E44E5B5119247C6C44BA7" />
</ContentTypes>
<Fields />
<Views>
<View BaseViewID="1" Type="HTML" WebPartZoneID="Main" DisplayName="$Resources:core,objectiv_schema_mwsidcamlidC24;" DefaultView="TRUE" MobileView="TRUE" MobileDefaultView="TRUE" SetupPath="pages\viewpage.aspx" ImageUrl="/_layouts/images/generic.png" Url="AllItems.aspx">
<XslLink Default="TRUE">main.xsl</XslLink>
<JSLink>clienttemplates.js</JSLink>
<RowLimit Paged="TRUE">30</RowLimit>
<Toolbar Type="Standard" />
<ViewFields>
<FieldRef Name="CategoryName"></FieldRef>
</ViewFields>
<Query>
<OrderBy>
<FieldRef Name="ID" />
</OrderBy>
</Query>
</View>
</Views>
<Forms>
<Form Type="DisplayForm" Url="DispForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
<Form Type="EditForm" Url="EditForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
<Form Type="NewForm" Url="NewForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
</Forms>
</MetaData>
</List>
The lists all deploy correctly, they're all visible in the SharePoint site, content can be added / edited and removed as normal - but PowerApps insists that they're not there.
(Yes, I can type the list name into the Enter custom list name
field and it connects, but that's not exactly user friendly). As an aside, they're not visible in Flow either, but again typing the name manually works!
I've tried a few different TemplateType
values, including 100
, 120
and 0
, none make a difference.
Can anyone see why the lists aren't visible in PowerApps?