0

I have here 2 questions :

  1. I created a document library with a specific name using the HTTP request action and would like to give this document library a friendlier name. If i use the same HTTP Request action, it creates an additional library with the new name> Any idea how i can simply update an existing library name ?

  2. Does anyone know how to add a newly created library automatically into the left handed menu of the site ? When i create it with the HTTP Request, it goes into the site content but does not show up in the site menu...

Thanks a lot for your help ! (sorry but my "hello all" is not showing up..)

3 Answers 3

1

Here is your complete answer to your 2 questions asked above

  1. You want to createt a SP Library using an HTTP request right? if so you can easily do that using Power Automate and "Send an HTTP request to SharePoint" action like this : enter image description here
  2. For showing your SP Library to Navigation, you need to add :"OnQuickLaunch": true to your JSON body as follow :

enter image description here

here is the JSON code :

{
"__metadata": {
"type": "SP.List"
    },
"BaseTemplate": 101,
"Description": "",
"Title": "LIB23",
"ListExperienceOptions":1,
"OnQuickLaunch": true
  }
  1. Now you want to update your existing library "Title" to a new Title, you need to do some changes on your HTTP request as follow :

enter image description here

as you can see :

  • The first change i made, i add ../getbytitle("old library title") in order to access the endpoint of that specified library,
  • second, you need to add "X-HTTP-Method : MERGE" and "***IF-MATCH : ****" headers
  • and then update your JSON code with your new required title, easy heh ?

Please, let me know if this worked for you, it's working for me pretty fine !

5
  • Hi @Aimen Boulahia, thanks for your answer. Yes this works. I cold create a new library, i just added "OnQuickLaunch: true" and now i see it in the menu. but what i was mentionning is that i still can't update the library name. so my screenshot was showing this is how to create the library (and add it to the menu) but how can i update the title ? if i follow what Jerry_MSFT said, it's the same as creation, that, just creates an additional library... thanks !!
    – Kaddrik
    Jan 20, 2021 at 9:24
  • So your need now, how to update the Title of an existing Library, right ? Jan 20, 2021 at 9:34
  • Ok so i quickly tested... but i hqve qn error becquse of the GetByTitle("libraryName") it says that "web/lists/GetByTitle("MyLib") is not valid. but it that's the right library name....
    – Kaddrik
    Jan 20, 2021 at 10:24
  • AAAAAHHHH !! ok... it works, i just put single quotes in the parenthesis of GetByTitle. Cool !!! thanks a lot for your help !!! :-)
    – Kaddrik
    Jan 20, 2021 at 10:34
  • Yeah, indeed single quotes works all the time, while double quotes work on French tenant, happy for you Jan 20, 2021 at 14:15
1

For updating the library title, please use the body below: It is an update request.

{
  "__metadata": {
    "type": "SP.List"
  },
  "Title": "NewLibraryName"
}

For creating libraries showed in left navigation, you will need to add the property

"OnQuickLaunch": true

My test works like this:

enter image description here

0

thanks a lot for your answer.

For the title update, it's the same thing as creating a new library. when i try this, it creates a new one with the new name... my URI is the same , method POST and body identical.

am I missing something ?

enter image description here

3
  • Here, you want to create a new library with a specified name, or you want to update the title of an existing library ? Jan 20, 2021 at 8:53
  • I want to update the name. I have a short name which is "LibraryName" and i have a "FriendlyName" property. I create the library, it takes the LibraryName...but then i want to update it so it takes the "FriendlyName". is it clearer ? So I guess i have to add a HTTP Request and add to the URI " _api/web/list/getByName("LibraryName") so in the body I can have Title reference "FriendlyName" . I just didn't have time to test if this is correct yet, i have lots of calls and meetings today :-P
    – Kaddrik
    Jan 20, 2021 at 9:40
  • Very well, check my answer again, i just update it Jan 20, 2021 at 9:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.