web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Dynamically create a S...
Power Automate
Unanswered

Dynamically create a SharePoint List AND format it with a button to trigger another flow

(0) ShareShare
ReportReport
Posted on by 18

Hi everyone,

 

TL;DR: How do I format SharePoint Lists created through HTTP Request during a flow?

 

My goal is to create a new SharePoint List with advanced view formatting with a Flow in Power Automate. 

 

I might be over-complicating what I want to do, but here is the context:

 

This is a flow that triggers when an item is added to my SharePoint List and creates another List and links back to it.

I got that part done using HTTP requests.

 

Here is my current flow.

sergio_flows_3-1681262495361.png

This is the body of the HTTP request:

sergio_flows_4-1681262561316.png

 

The next part would be to format the new SharePoint List view to include a new button in the command bar that, when clicked triggers another Flow that will allow me to add multiple copies of the same record when specified. For example:

     The new button would prompt to a formatted record entry form that would ask for the following fields:

 

     Input

          Number of vials: 3

          Reagent: Cell Culture Media

          Location: Lab1

          Expiration: 04/20/2023

 

     Output

          Item Name, Location, Expiration

          Cell Culture Media, Lab1, 04/20/2023

          Cell Culture Media, Lab1, 04/20/2023

          Cell Culture Media, Lab1, 04/20/2023

 

      This entry will add 3 items (ie. 3 rows) to the new SharePoint List. All with the same data (different autogenerated IDs of course).

 

The main problem for me is that I want to do this by formatting the view and/or column at the moment of making the new SharePoint List, modifying this section:

sergio_flows_5-1681264235300.png

 

Is this possible?

 

Some workarounds I've thought of are:

      1. Create a base template myself for the new SharePoint List in the folder where they will be created, then make the first flow just copy that template list with a new name whenever a new item is added to the master List.

      2. Make the 2nd Flow trigger automatically when a new item is added to any SharePoint List in the folder where the new Lists will be saved, forgetting about formatting and adding the new button to the new SharePoint List dynamically.

 

Thank you!

 

Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,828 Most Valuable Professional on at

    Hi @sergio_flows,

     

    You can use a setviewxml method to update the customformatter property of your newly created view.


    Below is an example

    In this example I am setting the alternating row styles formatting.

     

    Payload Body

    {"viewXml":"<View Name=\"{@{variables('ViewId')}}\" Type=\"HTML\" DisplayName=\"Formatted View\" Url=\"/sites/PowerUsers/@{variables('ListName')}/Forms/Formatted View.aspx\" Level=\"1\" BaseViewID=\"1\" ContentTypeID=\"0x\" ImageUrl=\"/_layouts/15/images/dlicon.png?rev=47\"><Query/><ViewFields><FieldRef Name=\"DocIcon\"/><FieldRef Name=\"LinkFilename\"/><FieldRef Name=\"Modified\"/><FieldRef Name=\"Editor\"/><FieldRef Name=\"ID\"/></ViewFields><RowLimit Paged=\"TRUE\">30</RowLimit><JSLink>clienttemplates.js</JSLink><XslLink Default=\"TRUE\">main.xsl</XslLink><CalendarViewStyles><CalendarViewStyle Title=\"Day\" Type=\"day\" Template=\"CalendarViewdayChrome\" Sequence=\"1\" Default=\"FALSE\"/><CalendarViewStyle Title=\"Week\" Type=\"week\" Template=\"CalendarViewweekChrome\" Sequence=\"2\" Default=\"FALSE\"/><CalendarViewStyle Title=\"Month\" Type=\"month\" Template=\"CalendarViewmonthChrome\" Sequence=\"3\" Default=\"FALSE\"/></CalendarViewStyles><Toolbar Type=\"Standard\"/><CustomFormatter><![CDATA[{\"additionalRowClass\":{\"operator\":\":\",\"operands\":[{\"operator\":\"==\",\"operands\":[{\"operator\":\"%\",\"operands\":[\"@rowIndex\",2]},0]},\"sp-css-backgroundColor-BgLightGray30\",{\"operator\":\":\",\"operands\":[{\"operator\":\"==\",\"operands\":[{\"operator\":\"%\",\"operands\":[\"@rowIndex\",2]},1]},\"sp-css-backgroundColor-noFill\",\"\"]}]},\"rowClassTemplateId\":\"BgColorAlternateRows\"}]]></CustomFormatter></View>"}

     

     

    setviewxml_customformatter.png

  • sergio_flows Profile Picture
    18 on at

    Hey @Expiscornovus ,

     

    This is really helpful, I didn't know there was an endpoint method to update the XML files from power automate.

    I tried what you suggested and the flow runs successfully, but I still can't see the alternating row formatting on this test list. See:

    sergio_flows_0-1681493872251.png

    (I made sure to name my variables the exact same as yours).

     

    Two follow up questions:

     

    1. Where can I find more complete documentation about the API endpoint methods? For example, the SetViewXml method is not mentioned in the docs for SharePoint as far as I can see .

     

    2. Is is possible to set the entire XML structure, including multiple fields, and view using only 1 post request? That way I wouldn't have to make multiple HTTP request in succession to add every field (I need to add 5) and then an extra one to edit the view.

     

    Thanks!

     

    PS: just subscribed to your channel

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 557

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 264 Super User 2026 Season 1

Last 30 days Overall leaderboard