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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Automating the showing...
Power Automate
Answered

Automating the showing of a SharePoint column in a Document Library

(0) ShareShare
ReportReport
Posted on by 84

Hello, 

 

I have built a SharePoint provisioning script with Power Automate and a final requirement is for the Sensitivity column to be visible within the Document Library.

Does anyone know of a way to automate this step?

Provision Columns.png

 

Thank you

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

    Hi @Carl__D,

     

    Yes, this should be possible via the SharePoint REST API. You can use a Send an HTTP request to SharePoint action for this.

    https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/working-with-lists-and-list-items-with-rest

     

    Below is an example with the Sensitivity column (internal name is _DisplayName).

     

    I am using two variables for the List Name and the View ID. You can replace that by your values.

     

    URI

    _api/web/lists/getByTitle('@{variables('ListName')}')/Views('@{variables('ViewId')}')/ViewFields/addViewField

     

    Body

    {
    "strField": "_DisplayName"
    }

     

    addfieldtoview.png

  • Carl__D Profile Picture
    84 on at

    Hi @Expiscornovus

     

    Thank you for your reply! 

     

    I'm sure I'm missing something obvious as fairly new to HTTP calls, but I believe I am replicating this process:

    HTTP.png

    But getting the following error:

     

    '{"odata.error":{"code":"-2147024809, System.ArgumentException","message":{"lang":"en-US","value":"The specified view is invalid."}}}

     

    I made a 'getbytitle' request further up the chain in order to parse out the View ID so I believe it is right. 

     

    Any help would be much appreciated. 

     

    Thanks

     

  • Expiscornovus Profile Picture
    33,195 Most Valuable Professional on at

    Hi @Carl__D,

     

    What values are you using for the ListName and ViewID variables?

    In my example I used TestLibrary & 5884FA4F-20DA-4D5B-9B42-95276E0A91FC (which is the All Documents view of my TestLibrary)

  • Carl__D Profile Picture
    84 on at

    Hi @Expiscornovus ,

     

    I'm also using a 'TestLibrary'.

     

    When sending a GET "_api/Web/Lists/getbytitle('TestLibrary')"

    I'm using the output:  "Id": "99b4711a-e3fb-4bfe-a4ad-513ee4ecac87"

     

    So my variables are:

    ListName = TestLibrary

    ViewID = 99B4711A-E3FB-4BFE-A4AD-513EE4ECAC87

     

    Thanks

  • Expiscornovus Profile Picture
    33,195 Most Valuable Professional on at

    Hi @Carl__D,

     

    Can you run the following two GET HTTP requests and check if those work?

     

    If so, can you share the outputs of those two responses? 

     

    getrequests_sendanhttprequest.png

  • Carl__D Profile Picture
    84 on at

    Ah i'm an idiot, I was using the List ID instead of the View ID. 

    Worked a treat. Thank you so much for your help with this! 🙂

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard