SOLVED

Rename Folder Error

%3CLINGO-SUB%20id%3D%22lingo-sub-1965235%22%20slang%3D%22en-US%22%3ERename%20Folder%20Error%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1965235%22%20slang%3D%22en-US%22%3E%3CP%3EGood%20Evening%20All!%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20working%20on%20creating%20a%20flow%20to%20duplicate%20a%20predetermined%20folder%20structure%20and%20then%20rename%20the%20folder%20based%20on%20a%20MS%20Forms%20submission.%26nbsp%3B%20I%20have%20the%20folder%20duplication%20into%20the%20correct%20location%20working%20correctly%2C%20however%20I%20cannot%20seem%20to%20fix%20the%20renaming%20step.%26nbsp%3B%20Each%20time%20I%20submit%2C%20I%20get%20the%20following%20error%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EThe%20expression%20%22web%2FGetFolderByServerRelativeUrl(%E2%80%98Completions%20Accounts%2FG550%2FStandard%20Folder%20Structure%E2%80%99)%2FListItemAllFields%22%20is%20not%20valid.%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3EclientRequestId%3A%2003bedea0-b37e-43cc-876a-f459bf8c6a68%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3EserviceRequestId%3A%205823959f-e0a9-b000-a059-014d61aebc56%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screen%20Shot%202020-12-07%20at%208.55.36%20PM.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F238538i9B82F919270CE597%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Screen%20Shot%202020-12-07%20at%208.55.36%20PM.png%22%20alt%3D%22Screen%20Shot%202020-12-07%20at%208.55.36%20PM.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%E2%80%83%3C%2FP%3E%3CP%3EAny%20ideas%3F%3F%26nbsp%3B%20Thank%20you!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1965235%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ERename%20Folder%20Error%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1966511%22%20slang%3D%22en-US%22%3ERe%3A%20Rename%20Folder%20Error%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1966511%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F526114%22%20target%3D%22_blank%22%3E%40GACVizDesign%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20can%20use%20this%20rest%20in%20your%20Uri%3A%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3E_api%2Fweb%2Flists%2Fgetbytitle('%5BDocument%20Library%20Name%20Here%5D')%2Fitems(%5BFolder%20ID%20Here%5D)%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20the%20Body%2C%20you%20should%20also%20specify%20the%20metadata%20type.%20You%20can%20check%20the%20screenshot%20below.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Ninijca_2-1607427919315.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F238622i30312C532D2FF706%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Ninijca_2-1607427919315.png%22%20alt%3D%22Ninijca_2-1607427919315.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1967294%22%20slang%3D%22en-US%22%3ERe%3A%20Rename%20Folder%20Error%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1967294%22%20slang%3D%22en-US%22%3E%3CP%3EThank%20you%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F894457%22%20target%3D%22_blank%22%3E%40Ninijca%3C%2FA%3E%20!%3C%2FP%3E%3CP%3EI%20cannot%20seem%20to%20figure%20out%20how%20to%20pull%20the%20ItemID%20%2F%20FolderID%20from%20the%20previous%20step...%20any%20thoughts%20on%20how%20to%20facilitate%20that%20step%3F%3F%26nbsp%3B%20Thanks%20again!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1969828%22%20slang%3D%22en-US%22%3ERe%3A%20Rename%20Folder%20Error%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1969828%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F526114%22%20target%3D%22_blank%22%3E%40GACVizDesign%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20you%20put%20your%20cursor%20in%20the%20%3CEM%3EUri%3C%2FEM%3E%2C%20there%20are%20suggestions%20in%20what%20you%20can%20add.%20Under%20%3CEM%3EDynamic%20content%3C%2FEM%3E%2C%20look%20for%20the%20previous%20action%20step's%20name%20which%20is%20%3CEM%3ECopy%20Folder%2C%26nbsp%3B%3C%2FEM%3Ethen%20select%20ItemId.%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ItemID.PNG%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F238941iBAF96818B8E47EF8%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22ItemID.PNG%22%20alt%3D%22ItemID.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20you%20have%20many%20actions%20already%20in%20your%20flow%20and%20it's%20difficult%20to%20find%20the%20ItemId%2C%20you%20can%20just%20search%20it.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ItemIDSearch.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F238942iD346C3C20200FDDF%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22ItemIDSearch.png%22%20alt%3D%22ItemIDSearch.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%E2%80%83%3C%2FP%3E%3CP%3E%E2%80%83%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1971577%22%20slang%3D%22en-US%22%3ERe%3A%20Rename%20Folder%20Error%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1971577%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F894457%22%20target%3D%22_blank%22%3E%40yenijc%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20again%20-%20you've%20been%20a%20big%20help!%26nbsp%3B%20I%20think%20I'm%20getting%20super%20close...%20However%2C%20I%20cannot%20for%20the%20life%20of%20me%20get%20past%20the%20error%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screen%20Shot%202020-12-09%20at%2010.10.59%20AM.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F239041i04592EF3EF52C8FC%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Screen%20Shot%202020-12-09%20at%2010.10.59%20AM.png%22%20alt%3D%22Screen%20Shot%202020-12-09%20at%2010.10.59%20AM.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%E2%80%83Here%20is%20the%20latest%20flow%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screen%20Shot%202020-12-09%20at%2010.06.14%20AM.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F239042iE107DE9CED59E27B%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Screen%20Shot%202020-12-09%20at%2010.06.14%20AM.png%22%20alt%3D%22Screen%20Shot%202020-12-09%20at%2010.06.14%20AM.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%E2%80%83Any%20thoughts%3F%26nbsp%3B%20Thank%20you%20again!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1974363%22%20slang%3D%22en-US%22%3ERe%3A%20Rename%20Folder%20Error%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1974363%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F526114%22%20target%3D%22_blank%22%3E%40GACVizDesign%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20see%20that%20you%20are%20using%20the%20default%20document%20library%20in%20the%20site%20which%20is%20the%20Documents.%20In%20your%20Uri%2C%20you%20should%20only%20write%20the%20document%20library's%20name%20in%20the%20getbytitle%20part%3A%26nbsp%3B%3CEM%3E_api%2Fweb%2Flists%2Fgetbytitle('%3CSTRONG%3EDocuments%3C%2FSTRONG%3E')%2Fitems(%5BItemId%20here%5D).%26nbsp%3B%3C%2FEM%3EIf%20you%20did%20not%20change%20the%20display%20name%20of%20your%20document%20library%2C%20that%20should%20work.%20However%2C%20if%20you%20changed%20it%2C%20please%20change%20the%20%3CEM%3E%3CSTRONG%3EDocuments%26nbsp%3B%3C%2FSTRONG%3E%3C%2FEM%3Eto%20your%20document%20library's%20current%20display%20name.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Documents%20doc%20lib.png%22%20style%3D%22width%3A%20684px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F239458iF94604130BDA07F2%2Fimage-dimensions%2F684x153%3Fv%3D1.0%22%20width%3D%22684%22%20height%3D%22153%22%20role%3D%22button%22%20title%3D%22Documents%20doc%20lib.png%22%20alt%3D%22Documents%20doc%20lib.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eand%20for%20the%20Body%2C%20the%20metadata%20type%20should%20be%26nbsp%3B%3CEM%3E%3CSTRONG%3ESP.Data.Shared_x0020_DocumentsItem%3C%2FSTRONG%3E%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%7B%0A%20%22__metadata%22%3A%20%7B%0A%20%20%22type%22%3A%20%22SP.Data.Shared_x0020_DocumentsItem%22%0A%20%7D%2C%0A%20%22FileLeafRef%22%3A%20%22Folder%20Name%22%0A%7D%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYour%20http%20request%20action%20should%20look%20like%20this%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22HTTP%20Request.PNG%22%20style%3D%22width%3A%20723px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F239462i9BB20E9D168EDFF2%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22HTTP%20Request.PNG%22%20alt%3D%22HTTP%20Request.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHope%20that%20helps.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1976380%22%20slang%3D%22en-US%22%3ERe%3A%20Rename%20Folder%20Error%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1976380%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F894457%22%20target%3D%22_blank%22%3E%40yenijc%3C%2FA%3EEureka!!%26nbsp%3B%20That%20did%20it!%26nbsp%3B%20Thank%20you%20so%20much%20for%20all%20your%20help%20-%20I%20greatly%20appreciate%20your%20time.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Good Evening All! 

I am working on creating a flow to duplicate a predetermined folder structure and then rename the folder based on a MS Forms submission.  I have the folder duplication into the correct location working correctly, however I cannot seem to fix the renaming step.  Each time I submit, I get the following error:

 

The expression "web/GetFolderByServerRelativeUrl(‘Completions Accounts/G550/Standard Folder Structure’)/ListItemAllFields" is not valid.
clientRequestId: 03bedea0-b37e-43cc-876a-f459bf8c6a68
serviceRequestId: 5823959f-e0a9-b000-a059-014d61aebc56

 

Screen Shot 2020-12-07 at 8.55.36 PM.png

Any ideas??  Thank you!

6 Replies

Hello @GACVizDesign 

 

You can use this rest in your Uri: 

_api/web/lists/getbytitle('[Document Library Name Here]')/items([Folder ID Here])

Use the itemId return from the Copy Folder action as the Folder ID.

 

In the Body, you should also specify the metadata type. You can check the screenshot below.

Ninijca_2-1607427919315.png

 

 

 

 

Thank you@yenijc !

I cannot seem to figure out how to pull the ItemID / FolderID from the previous step... any thoughts on how to facilitate that step??  Thanks again!

Hi @GACVizDesign ,

 

When you put your cursor in the Uri, there are suggestions in what you can add. Under Dynamic content, look for the previous action step's name which is Copy Folder, then select ItemId. 

ItemID.PNG

 

If you have many actions already in your flow and it's difficult to find the ItemId, you can just search it.

ItemIDSearch.png

 

 

@yenijc 

Thank you again - you've been a big help!  I think I'm getting super close... However, I cannot for the life of me get past the error:

Screen Shot 2020-12-09 at 10.10.59 AM.png

 Here is the latest flow:

Screen Shot 2020-12-09 at 10.06.14 AM.png

 Any thoughts?  Thank you again!

best response confirmed by GACVizDesign (Occasional Contributor)
Solution

@GACVizDesign 

 

I see that you are using the default document library in the site which is the Documents. In your Uri, you should only write the document library's name in the getbytitle part: _api/web/lists/getbytitle('Documents')/items([ItemId here]). If you did not change the display name of your document library, that should work. However, if you changed it, please change the Documents to your document library's current display name. 

 

Documents doc lib.png

 

and for the Body, the metadata type should be SP.Data.Shared_x0020_DocumentsItem

 

{
	"__metadata": {
		"type": "SP.Data.Shared_x0020_DocumentsItem"
	},
	"FileLeafRef": "Folder Name"
}

 

 

Your http request action should look like this:

HTTP Request.PNG

 

Hope that helps.

@yenijcEureka!!  That did it!  Thank you so much for all your help - I greatly appreciate your time.