SOLVED

Logic App Update File Properties throws an exception after a SPO file successful checkout

%3CLINGO-SUB%20id%3D%22lingo-sub-1829777%22%20slang%3D%22en-US%22%3ELogic%20App%20Update%20File%20Properties%20throws%20an%20exception%20after%20a%20SPO%20file%20successful%20checkout%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1829777%22%20slang%3D%22en-US%22%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFirstly%2C%20the%20Update%20File%20Properties%26nbsp%3B%20in%20the%20action%20sequence%20has%20been%20working%20pefectly%26nbsp%3B%20until%20we%20introduced%20mandatory%20checkouts%20in%20the%26nbsp%3B%20sharePont%20document%20library.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDelay%20(10s)%20and%20Get%20file%20properties%20I%20added%20to%20day%20for%20debugging%20purposes.%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%22check%20out%20failure.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F229924iB7B85C2CA3E869A3%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22check%20out%20failure.png%22%20alt%3D%22check%20out%20failure.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENo%20the%20strange%20thing%20is%20I%20manully%20check%20in%20the%20document%20and%20trigger%20the%20Logic%20App.%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20logic%20app%20successfully%20checks%20out%20the%20document.%20Here%20is%20the%20output%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3Eheaders%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22X-SharePointHealthScore%22%3A%20%222%22%2C%0A%20%20%20%20%20%20%20%20%22X-MS-SPConnector%22%3A%20%221%22%2C%0A%20%20%20%20%20%20%20%20%22X-SP-SERVERSTATE%22%3A%20%22ReadOnly%3D0%22%2C%0A%20%20%20%20%20%20%20%20%22DATASERVICEVERSION%22%3A%20%223.0%22%2C%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHowever%2C%20the%20Update%20fails%20with%20this%20odd%20error%3A%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%3CPRE%20class%3D%22lia-code-sample%20language-json%22%3E%3CCODE%3E%20%22body%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22status%22%3A%20400%2C%0A%20%20%20%20%20%20%20%20%22message%22%3A%20%22The%20file%20%5C%22https%3A%2F%2Fmydev.sharepoint.com%2Fsites%2FDansDoodles%2Ftest.dscs%5C%22%20is%20checked%20out%20for%20editing%20by%20i%3A0%23.f%7Cmembership%7CDaniel.....%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20is%20complaining%20that%20I%20have%20checked%20out%20file%3B%20which%20I%20had%20to%20do%20in%20the%20previous%20acton!!!!!!%26nbsp%3B%20The%20document%20is%20not%20open%20in%20any%20browser%20tab%20or%20desktop.%20Also%2C%20I%20have%20set%20up%20the%20all%20the%20connections%20under%20the%20same%20account.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EUpdate%3A%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22check%20out%20failure%20and%20more%20weirdness.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F230121iAD2D4B20A3601790%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22check%20out%20failure%20and%20more%20weirdness.png%22%20alt%3D%22check%20out%20failure%20and%20more%20weirdness.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EI%20wonder%20if%20Power%20Automate%20is%20any%20better%26nbsp%3B%3CIMG%20class%3D%22lia-deferred-image%20lia-image-emoji%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Fhtml%2Fimages%2Femoticons%2Funamused_40x40.gif%22%20alt%3D%22%3Aunamused%3A%22%20title%3D%22%3Aunamused%3A%22%20%2F%3E%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1829777%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAutomation%20%26amp%3B%20Control%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Regular Contributor

 

Firstly, the Update File Properties  in the action sequence has been working pefectly  until we introduced mandatory checkouts in the  sharePont document library.

 

Delay (10s) and Get file properties I added to day for debugging purposes.

 

check out failure.png

 

No the strange thing is I manully check in the document and trigger the Logic App. 

The logic app successfully checks out the document. Here is the output

 

 

 

headers": {
        "X-SharePointHealthScore": "2",
        "X-MS-SPConnector": "1",
        "X-SP-SERVERSTATE": "ReadOnly=0",
        "DATASERVICEVERSION": "3.0",

 

 

 

However, the Update fails with this odd error: 

 

 

 

 "body": {
        "status": 400,
        "message": "The file \"https://mydev.sharepoint.com/sites/DansDoodles/test.dscs\" is checked out for editing by i:0#.f|membership|Daniel.....

 

 

 

It is complaining that I have checked out file; which I had to do in the previous acton!!!!!!  The document is not open in any browser tab or desktop. Also, I have set up the all the connections under the same account.

 

Update:  

check out failure and more weirdness.png

I wonder if Power Automate is any better :unamused:?

1 Reply
best response confirmed by Daniel Westerdale (Regular Contributor)
Solution

Hmmmmmmm,  the answer is obvious ( just not to me :facepalm:).

 

Both Update Item and Check out actions need to reference the same connection  in order facilite and orderly deployment between enviroments ( and not to appear as two different users) . You can make the required changes in  UI or in the code view ( see below(.

 

 

 "type": "ApiConnection",
                    "inputs": {
                      "host": {
                        "connection": {
                          "name": "@parameters('$connections')['sharepointonline']['connectionId']"
                        }
                      },