cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
JimmyWork
Level 8

Create SharePoint list from XML file in flow

Hi

 

Im having a bit of trouble understanding how i can do this.
I want to create a SharePoint list based on a xml file. I want to parse the XML or have it in a variable in flow so i can edit the title and so on using dynamic content. I can apply it as a template using a runbook but i want to be able input the new title of the list as i will use it as a template to create multiple lists with different names.

 

Im not sure how i can have a runbook that gets the raw xml input and then creates a list from it. If it's possible to do using Graph or any other solution please let me know

3 REPLIES 3
Dual Super User
Dual Super User

Re: Create SharePoint list from XML file in flow

Hi

Can you share an example of your XML content?

IN this post, you will find an explanation on how to iterate through certain nodes from an XML. I assume you need to identify the node you want to convert into SP items, iterate throught them with an Apply to Each, inside the Apply to each invoke SP "Create item" action block

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



JimmyWork
Level 8

Re: Create SharePoint list from XML file in flow

@efialttes Thank you for answering, i created a xml file from a list only.

 

Step 1: Get-PnPProvisioningTemplate -Handlers Lists -ListsToExtract 'ExtInvite' -Out C:\pnp\list.xml

Step 2: Add-PnPDataRowsToProvisioningTemplate -path 'C:\pnp\list.xml' -List 'ExtInvite' -Query '<view>>/view>'

 

I can then create a list by doing Apply-PnPProvisioningTemplate -Path C:\pnp\list.xml and it will only create a list, nothing else is applied.

 

I dont want to create an item in a list i want ot create a list based on a template. The template i have in a xml file format. But i want to be able to manipulate the xml file in flow with dynamic content for example adding a new title of the list and so on.

 

This basically show what i want to do but without using their flow parts.

 

https://plumsail.com/docs/actions/v1.x/flow/how-tos/sharepoint/create-list-library-pnp.html

 

 

JimmyWork
Level 8

Re: Create SharePoint list from XML file in flow

I have tried this but i get errors.

 

$template = Read-PnPProvisioningTemplate -Xml $yourtemplatestring
Apply-PnPProvisioningTemplate -InputInstance $template

 

Errors i get.

Apply-PnPProvisioningTemplate : Cannot bind parameter 'InputInstance'. Cannot convert value 
"OfficeDevPnP.Core.Framework.Provisioning.Model.ProvisioningTemplate" to type 
"OfficeDevPnP.Core.Framework.Provisioning.Model.ProvisioningTemplate". Error: "Cannot convert the 
"OfficeDevPnP.Core.Framework.Provisioning.Model.ProvisioningTemplate" value of type 
"Deserialized.OfficeDevPnP.Core.Framework.Provisioning.Model.ProvisioningTemplate" to type 
"OfficeDevPnP.Core.Framework.Provisioning.Model.ProvisioningTemplate"."
At CreateListXMLTemplate:16 char:16
+ 
    + CategoryInfo          : InvalidArgument: (:) [Apply-PnPProvisioningTemplate], ParameterBindingException
    + FullyQualifiedErrorId : 
CannotConvertArgumentNoMessage,SharePointPnP.PowerShell.Commands.Provisioning.Site.ApplyProvisioningTemplate

Helpful resources

Announcements
firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (3,790)