{"id":154303,"date":"2023-12-12T15:11:32","date_gmt":"2023-12-12T06:11:32","guid":{"rendered":"https:\/\/support.questetra.com\/?p=154303"},"modified":"2023-12-12T15:11:34","modified_gmt":"2023-12-12T06:11:34","slug":"service-task-onedrive-file-move","status":"publish","type":"post","link":"https:\/\/support.questetra.com\/en\/bpmn-icons\/service-task-onedrive-file-move\/","title":{"rendered":"Microsoft 365 OneDrive for Business: Move File \/ Folder"},"content":{"rendered":"\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"58\" data-attachment-id=\"113160\" data-permalink=\"https:\/\/support.questetra.com\/en\/developer-blog\/how-to-use-timer-start-event\/attachment\/advanced-banner-new-en\/\" data-orig-file=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/05\/advanced-banner-new-en.png?fit=1200%2C68&amp;ssl=1\" data-orig-size=\"1200,68\" data-comments-opened=\"0\" data-image-title=\"advanced-banner-new-en\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/05\/advanced-banner-new-en.png?fit=1024%2C58&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/05\/advanced-banner-new-en-1024x58.png?resize=1024%2C58&#038;ssl=1\" alt=\"\" class=\"wp-image-113160\" srcset=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/05\/advanced-banner-new-en.png?resize=1024%2C58&amp;ssl=1 1024w, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/05\/advanced-banner-new-en.png?resize=600%2C34&amp;ssl=1 600w, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/05\/advanced-banner-new-en.png?resize=768%2C44&amp;ssl=1 768w, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/05\/advanced-banner-new-en.png?w=1200&amp;ssl=1 1200w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h4 class=\"wp-block-heading has-border-color has-product-main-border-color has-white-color has-product-main-background-color has-text-color has-background has-link-color\" style=\"border-width:2px;margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:var(--wp--preset--spacing--10);padding-right:var(--wp--preset--spacing--20);padding-bottom:var(--wp--preset--spacing--10);padding-left:var(--wp--preset--spacing--20)\"><strong>Microsoft 365 OneDrive for Business: Move File \/ Folder<\/strong><\/h4>\n\n\n\n<p class=\"has-text-align-right has-border-color has-product-main-border-color has-white-color has-product-main-background-color has-text-color has-background has-link-color has-small-font-size mt-0 pt-0 wp-block-paragraph\" style=\"border-width:2px;margin-top:0;margin-right:0;margin-bottom:0;margin-left:0;padding-top:0;padding-right:var(--wp--preset--spacing--20);padding-bottom:0;padding-left:var(--wp--preset--spacing--20)\"><a href=\"https:\/\/support.questetra.com\/en\/bpmn-icons\/service-task-onedrive-file-move\/\">Microsoft 365 OneDrive for Business: \u30d5\u30a1\u30a4\u30eb \/ \u30d5\u30a9\u30eb\u30c0\u79fb\u52d5<\/a><\/p>\n\n\n\n<p class=\"has-border-color has-product-main-border-color has-text-color has-white-background-color has-background has-link-color mt-0 pt-0 wp-block-paragraph\" style=\"border-width:2px;margin-top:0;margin-right:0;margin-bottom:var(--wp--preset--spacing--30);margin-left:0;padding-top:var(--wp--preset--spacing--20);padding-right:var(--wp--preset--spacing--20);padding-bottom:var(--wp--preset--spacing--20);padding-left:var(--wp--preset--spacing--20)\">This item moves the specified file\/folder to the specified folder on OneDrive. The file\/folder cannot be moved between drives.<\/p>\n\n\n\n<div class=\"wp-block-coblocks-accordion\">\n<div class=\"wp-block-coblocks-accordion-item\"><details open><summary class=\"wp-block-coblocks-accordion-item__title\">Basic Configs<\/summary><div class=\"wp-block-coblocks-accordion-item__content\">\n<dl style=\"0 0 -0.7em 0\">\n<dt style=\"font-weight: 300; font-size: 50%; margin: -1em 0 0 0; color: #C3C3C3;\"><\/dt><dd style=\"margin: -0.5em 0 0.1em 1em\">Step Name<\/dd>\n<dt style=\"font-weight: 300; font-size: 50%; margin: -1em 0 0 0; color: #C3C3C3;\"><\/dt><dd style=\"margin: -0.5em 0 0.1em 1em\">Note<\/dd>\n<\/dl>\n<\/div><\/details><\/div>\n<\/div>\n\n\n\n<figure class=\"wp-block-image alignright has-custom-border is-style-default\"><img decoding=\"async\" src=\"data:image;base64,\n    iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAADXUlEQVRYR8WXW0hUURSG\/33GbC5e\n    8pJJF6nM6YKUmsFAIAZSONOM4FtqL\/mQVg9GhXR5iCIiEAqF9KEMsvKpi06OZoRPGaRmVoSGU4om\n    aqaMzeXYOLPjTJ7R41w8k8bZLwNn1r\/Wt9dee+29CSQeRHR8vVEpd7vzGTAHKKXpADYDiJnTTwEY\n    IIR0u+FuYxnmCYx6uxjfSwKotE2JbuoqB0EJALkYpwBYUNQwRHbDZtKNBtMEBVBqG0ooSAUAlcjA\n    i81sBPSs3ZRXE0gfEECuM94mlJb+Y2CBjBJSzTbpT\/jz5RdAoTU+BGjBSgSf90EeOUz6wsU+fQBW\n    cuaLg\/nLhABgbs2rV3bmQm8EtHRhTXgBPNUOV\/8yCk4st42BbBu\/O7wAitzGmyAoE+tlWXYUtxzN\n    htOcj78AeqNS4aI\/Q9jneH5Ng0x1DCLkMlhZFz59m0ZZ9UfPr4jBOmQkjmtWHgC5rqGIUFIXTHih\n    QI3UzVHoH7HhsCYROzZF+JgPjNqxq\/iViPgAJfQo25T3wAOg1BnvUkqP+VNGKsLQXpmF5PXCXmR1\n    zKJvyAqL3Yn4qHCoN0ZCHs6gvm0YxRXdS0IQQmrtTfpiD4BC2\/gOANfffUbjVQ1yMtYKvnNZGJlg\n    kZESDeVqGSy2WbzoHPdkpdtswcnKniUBAHQ7TIYMHmBywcEiEPfey0FSgsL7zWJzosc8jazdcQI7\n    l5tiwvIbUaowTE47UfXMjMqnX4OBTDlMhlgegC62TNmgwp0z6UhLjsaqMMbzN5f25o4x5O5bhwhF\n    WNBZ2mdcyDn3Gu\/NloB2DpOBBAToqs7GzqRIr\/j7BIu+4V9I2xqN2KhwMSlGbcsgTlV9EAXgswSW\n    Bp135pQCrV3jOJSZICowb2RjXWjtHEfh9U5\/OsES+BThj8daqOQyb+q\/DFuRkbImJADOmKuNg+Xt\n    ePOZm6NgzBehv21YfzETek0iGIZgxun2OMjeEx8yACfIv\/wWLR1jAq1gGwZqROePqLE\/NRZjUzOo\n    ezmE++V7ER8tbv35aFzm0o63+YALGlEorfhS0XZsSVSKysTgmANX6nr92QpbMWch7WHEncFSH8dc\n    FiS9kPALJemVjIeQ9FL6PzIR8rWch5D0YcJDSPo0E3QQqR6nolreMoz+ACVfiTBvFfnjAAAAAElF\n    TkSuQmCC\n    \" alt=\"Auto Step icon\" class=\"has-border-color has-ast-global-color-4-border-color\" style=\"border-width:0.5em\"\/><\/figure>\n\n\n\n<div class=\"wp-block-coblocks-accordion\">\n<div class=\"wp-block-coblocks-accordion-item\"><details open><summary class=\"wp-block-coblocks-accordion-item__title\">Configs for this Auto Step<\/summary><div class=\"wp-block-coblocks-accordion-item__content\">\n<dl style=\"0 0 -0.7em 0\">\n<dt style=\"font-weight: 300; font-size: 50%; margin: -1em 0 0 0; color: #aaa;\">conf_OAuth2<\/dt><dd style=\"margin: -0.5em 0 0.1em 1em\">C1: OAuth2 Setting<span style=\"color:#990000;\"> *<\/span><\/dd>\n<dt style=\"font-weight: 300; font-size: 50%; margin: -1em 0 0 0; color: #aaa;\">conf_SourceUrl<\/dt><dd style=\"margin: -0.5em 0 0.1em 1em\">C2: File \/ Folder URL to move<span style=\"color:#990000;\"> *<\/span><\/dd>\n<dt style=\"font-weight: 300; font-size: 50%; margin: -1em 0 0 0; color: #aaa;\">conf_DestUrl<\/dt><dd style=\"margin: -0.5em 0 0.1em 1em\">C3: Folder URL to move to<span style=\"color:#990000;\"> *<\/span><\/dd>\n<dt style=\"font-weight: 300; font-size: 50%; margin: -1em 0 0 0; color: #aaa;\">conf_NewUrl<\/dt><dd style=\"margin: -0.5em 0 0.1em 1em\">C4: Data item to save new file \/ folder URL after being moved<\/dd>\n\n<\/dl>\n<\/div><\/details><\/div>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\" style=\"margin-top:var(--wp--preset--spacing--30)\"><span>Notes<\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>This Auto Step is for OneDrive for Business of Microsoft 365\n<ul class=\"wp-block-list\">\n<li>It does not work for OneDrive personal<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>To get the URL of a file\/folder on OneDrive, open the Details window of the file\/folder by clicking the Information icon, proceed to \u201cMore details\u201d, and click the icon next to \u201cPath\u201d<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized has-custom-border\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"461\" height=\"630\" data-attachment-id=\"153543\" data-permalink=\"https:\/\/support.questetra.com\/en\/bpmn-icons\/service-task-onedrive-file-link-create\/attachment\/onedrive_howtogeturl_en-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2023\/10\/OneDrive_HowToGetURL_en.png?fit=616%2C842&amp;ssl=1\" data-orig-size=\"616,842\" data-comments-opened=\"0\" data-image-title=\"OneDrive_HowToGetURL_en\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2023\/10\/OneDrive_HowToGetURL_en.png?fit=461%2C630&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2023\/10\/OneDrive_HowToGetURL_en.png?resize=461%2C630&#038;ssl=1\" alt=\"\" class=\"has-border-color wp-image-153543\" style=\"border-color:#009900;border-width:3px;width:280px\" srcset=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2023\/10\/OneDrive_HowToGetURL_en.png?resize=461%2C630&amp;ssl=1 461w, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2023\/10\/OneDrive_HowToGetURL_en.png?resize=230%2C315&amp;ssl=1 230w, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2023\/10\/OneDrive_HowToGetURL_en.png?w=616&amp;ssl=1 616w\" sizes=\"auto, (max-width: 461px) 100vw, 461px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The file\/folder cannot be moved between drives\n<ul class=\"wp-block-list\">\n<li>You can use <a href=\"https:\/\/support.questetra.com\/en\/bpmn-icons\/onedrive-file-copy\/\" target=\"_blank\" rel=\"noreferrer noopener\">Microsoft 365 OneDrive for Business: Copy File \/ Folder<\/a> to copy a file\/folder to another drive<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" style=\"margin-top:var(--wp--preset--spacing--30)\"><span>Capture<\/span><\/h3>\n\n\n\n<figure class=\"wp-block-image size-full has-custom-border is-style-rounded is-style-rounded--1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1194\" height=\"1140\" data-attachment-id=\"154304\" data-permalink=\"https:\/\/support.questetra.com\/en\/incident\/trouble-20240124\/attachment\/onedrive-file-move_capture_en\/\" data-orig-file=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2023\/11\/onedrive-file-move_capture_en.png?fit=1194%2C1140&amp;ssl=1\" data-orig-size=\"1194,1140\" data-comments-opened=\"0\" data-image-title=\"onedrive-file-move_capture_en\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2023\/11\/onedrive-file-move_capture_en.png?fit=660%2C630&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2023\/11\/onedrive-file-move_capture_en.png?resize=1194%2C1140&#038;ssl=1\" alt=\"\" class=\"has-border-color wp-image-154304\" style=\"border-color:#009900;border-width:3px;border-radius:9px\" srcset=\"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2023\/11\/onedrive-file-move_capture_en.png?w=1194&amp;ssl=1 1194w, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2023\/11\/onedrive-file-move_capture_en.png?resize=330%2C315&amp;ssl=1 330w, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2023\/11\/onedrive-file-move_capture_en.png?resize=660%2C630&amp;ssl=1 660w, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2023\/11\/onedrive-file-move_capture_en.png?resize=768%2C733&amp;ssl=1 768w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" style=\"margin-top:var(--wp--preset--spacing--30)\"><span>See also<\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/support.questetra.com\/en\/bpmn-icons\/intermediate-error-catch-event-boundary-type\/\" target=\"_blank\" rel=\"noreferrer noopener\">Intermediate Error Catch Event (Boundary Type)<\/a><\/li>\n<\/ul>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-coblocks-accordion\">\n<div class=\"wp-block-coblocks-accordion-item\"><details><summary class=\"wp-block-coblocks-accordion-item__title\">Script (click to open)<\/summary><div class=\"wp-block-coblocks-accordion-item__content\">\n<ul class=\"wp-block-list\">\n<li>An XML file that contains the code below is available to download\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/raw.githubusercontent.com\/Questetra\/Addon-XML\/release-2023-10-23\/onedrive-file-move.xml\" target=\"_blank\" rel=\"noreferrer noopener\">onedrive-file-move.xml<\/a> (C) Questetra, Inc. (MIT License)<\/li>\n\n\n\n<li>If you are using Professional, you can modify the contents of this file and use it as your own add-on auto step<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>\n\/\/ OAuth2 config sample at [OAuth 2.0 Setting]\n\/\/ - Authorization Endpoint URL: https:\/\/login.microsoftonline.com\/{your-tenant-id}\/oauth2\/v2.0\/authorize\n\/\/ - Token Endpoint URL: https:\/\/login.microsoftonline.com\/{your-tenant-id}\/oauth2\/v2.0\/token\n\/\/ - Scope: https:\/\/graph.microsoft.com\/Files.ReadWrite.All offline_access\n\/\/ - Consumer Key: (Get by Microsoft Azure Active Directory)\n\/\/ - Consumer Secret: (Get by Microsoft Azure Active Directory)\n\n\/\/ \u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\nconst GRAPH_URI = &quot;https:\/\/graph.microsoft.com\/v1.0\/&quot;;\n\nfunction main() {\n    \/\/\/\/ == Config Retrieving \/ \u5de5\u7a0b\u30b3\u30f3\u30d5\u30a3\u30b0\u306e\u53c2\u7167 ==\n    const oauth2 = configs.getObject(&#39;conf_OAuth2&#39;);\n    const sourceUrl = retrieveSourceUrl();\n    const destUrl = retrieveDestUrl();\n    const newUrlDef = configs.getObject(&#39;conf_NewUrl&#39;);\n\n    \/\/\/\/ == Calculating \/ \u6f14\u7b97 ==\n    \/\/ getting itemInfo for Requesting Copy and Updating Data\n    const sourceInfo = getItemInfoByUrl(oauth2, sourceUrl);\n    const destInfo = getItemInfoByUrl(oauth2, destUrl);\n    \/\/ sending Move Request\n    const newUrl = moveDriveItem(oauth2, sourceInfo, destInfo);\n\n    \/\/\/\/ == \u30ef\u30fc\u30af\u30d5\u30ed\u30fc\u30c7\u30fc\u30bf\u3078\u306e\u4ee3\u5165 \/ Data Updating ==\n    if (newUrlDef !== null) {\n        engine.setData(newUrlDef, newUrl);\n    }\n}\n\n\/**\n  * config \u304b\u3089\u79fb\u52d5\u3059\u308b\u30a2\u30a4\u30c6\u30e0\u306e URL \u3092\u8aad\u307f\u51fa\u3059\n  * \u6587\u5b57\u578b\u30c7\u30fc\u30bf\u9805\u76ee\u306e\u307f\n  * \u7a7a\u306e\u5834\u5408\u306f\u30a8\u30e9\u30fc\n  * @return {String} sourceUrl\n  *\/\nfunction retrieveSourceUrl() {\n    const sourceUrl = engine.findData(configs.getObject(&#39;conf_SourceUrl&#39;));\n    if (sourceUrl === null) {\n        throw &#39;Source file \/ folder URL is blank.&#39;;\n    }\n    return sourceUrl;\n}\n\n\/**\n  * config \u304b\u3089\u79fb\u52d5\u5148\u30d5\u30a9\u30eb\u30c0\u306e URL \u3092\u8aad\u307f\u51fa\u3059\n  * \u6587\u5b57\u578b\u30c7\u30fc\u30bf\u9805\u76ee\u3001\u307e\u305f\u306f\u56fa\u5b9a\u5024\n  * \u7a7a\u306e\u5834\u5408\u306f\u30a8\u30e9\u30fc\n  * @return {String} destUrl\n  *\/\nfunction retrieveDestUrl() {\n    const destUrlDef = configs.getObject(&#39;conf_DestUrl&#39;);\n    let destUrl = configs.get(&#39;conf_DestUrl&#39;);\n    if (destUrlDef !== null) {\n        destUrl = engine.findData(destUrlDef);\n    }\n    if (destUrl === &#39;&#39; || destUrl === null) {\n        throw &#39;Destination folder URL is blank.&#39;;\n    }\n    return destUrl;\n}\n\n\/**\n  * \u30c9\u30e9\u30a4\u30d6\u30a2\u30a4\u30c6\u30e0\u306e URL \u304b\u3089\u30a2\u30a4\u30c6\u30e0\u60c5\u5831\uff08\u30c9\u30e9\u30a4\u30d6 ID \u3068\u30a2\u30a4\u30c6\u30e0 ID\uff09\u3092\u53d6\u5f97\u3057\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u8fd4\u3059\n  * @param {AuthSettingWrapper} oauth2  OAuth2 \u8a8d\u8a3c\u8a2d\u5b9a\n  * @param {String} driveItemUrl  \u30c9\u30e9\u30a4\u30d6\u30a2\u30a4\u30c6\u30e0\uff08\u30d5\u30a1\u30a4\u30eb\u3001\u30d5\u30a9\u30eb\u30c0\uff09\u306eURL\n  * @return {Object} itemInfo  \u30c9\u30e9\u30a4\u30d6\u30a2\u30a4\u30c6\u30e0\u60c5\u5831 {driveId, id}\n  *\/\nfunction getItemInfoByUrl(oauth2, driveItemUrl) {\n    const {\n        id,\n        parentReference: {\n            driveId\n        }\n    } = getObjBySharingUrl(oauth2, driveItemUrl);\n    return {driveId, id};\n}\n\n\/**\n  * OneDrive \u306e\u30c9\u30e9\u30a4\u30d6\u30a2\u30a4\u30c6\u30e0\uff08\u30d5\u30a1\u30a4\u30eb\u3001\u30d5\u30a9\u30eb\u30c0\uff09\u306e\u30e1\u30bf\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u3001JSON \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u8fd4\u3059\n  * API\u306e\u4ed5\u69d8: https:\/\/docs.microsoft.com\/ja-jp\/onedrive\/developer\/rest-api\/api\/shares_get?view=odsp-graph-online\n  * @param {String} oauth2  OAuth2 \u8a8d\u8a3c\u8a2d\u5b9a\n  * @param {String} sharingUrl  \u30c9\u30e9\u30a4\u30d6\u30a2\u30a4\u30c6\u30e0\u306e\u5171\u6709URL\n  * @return {Object} responseObj  \u30c9\u30e9\u30a4\u30d6\u30a2\u30a4\u30c6\u30e0\u306e\u30e1\u30bf\u30c7\u30fc\u30bf\u306eJSON\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\n  *\/\nfunction getObjBySharingUrl(oauth2, sharingUrl) {\n    const encodedSharingUrl = encodeSharingUrl(sharingUrl);\n    const response = httpClient.begin()\n        .authSetting(oauth2)\n        .queryParam(&#39;select&#39;, &#39;id,parentReference\/driveId&#39;)\n        .get(`${GRAPH_URI}shares\/${encodedSharingUrl}\/driveItem`);\n    const status = response.getStatusCode();\n    const responseStr = response.getResponseAsString();\n    if (status !== 200) {\n        engine.log(responseStr);\n        throw `Failed to get drive item. status: ${status}`;\n    }\n    return JSON.parse(responseStr);\n}\n\n\/**\n  * \u5171\u6709 URL \u3092 unpadded base64url \u5f62\u5f0f\u306b\u30a8\u30f3\u30b3\u30fc\u30c9\u3059\u308b\n  * @param {String} sharingUrl  \u5171\u6709URL\n  * @return {String} encodedSharingUrl  \u30a8\u30f3\u30b3\u30fc\u30c9\u3055\u308c\u305f\u5171\u6709URL\n  *\/\nfunction encodeSharingUrl(sharingUrl) {\n    let encodedSharingUrl = base64.encodeToUrlSafeString(sharingUrl);\n    while (encodedSharingUrl.slice(-1) === &#39;=&#39;) {\n        encodedSharingUrl = encodedSharingUrl.slice(0, -1);\n    }\n    return `u!${encodedSharingUrl}`;\n}\n\n\/**\n  * \u30d5\u30a1\u30a4\u30eb \/ \u30d5\u30a9\u30eb\u30c0\u3092\u79fb\u52d5\u3059\u308b\n  * @param {AuthSettingWrapper} oauth2  OAuth2 \u8a8d\u8a3c\u8a2d\u5b9a\n  * @param {Object} sourceInfo  \u79fb\u52d5\u3059\u308b\u30a2\u30a4\u30c6\u30e0\u60c5\u5831 {driveId, id}\n  * @param {Object} destInfo  \u79fb\u52d5\u5148\u30d5\u30a9\u30eb\u30c0\u60c5\u5831 {driveId, id}\n  * @return {String} newUrl  \u79fb\u52d5\u3057\u305f\u30a2\u30a4\u30c6\u30e0\u306e\u65b0\u3057\u3044 URL\n  *\/\nfunction moveDriveItem(oauth2, sourceInfo, destInfo) {\n    if (sourceInfo.driveId !== destInfo.driveId) {\n        throw &#39;Cannot move between drives. Copy the file\/folder instead.&#39;;\n    }\n    const apiUri = `${GRAPH_URI}drives\/${sourceInfo.driveId}\/items\/${sourceInfo.id}`;\n    const requestBodyObj = {\n        parentReference: {\n            id: destInfo.id\n        }\n    };\n    const response = httpClient.begin()\n        .authSetting(oauth2)\n        .body(JSON.stringify(requestBodyObj), &#39;application\/json&#39;)\n        .patch(apiUri);\n    const status = response.getStatusCode();\n    const responseStr = response.getResponseAsString();\n    if (status !== 200) {\n        engine.log(responseStr);\n        throw `Failed to move. status: ${status}`;\n    }\n    return JSON.parse(responseStr).webUrl;\n}\n\n    <\/code><\/pre><\/div>\n<\/div><\/details><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>This item moves the specified file\/folder to the specified folder on OneDrive. The file\/folder cannot be moved between drives.<\/p>\n","protected":false},"author":17,"featured_media":110810,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","_uag_custom_page_level_css":"","advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_seo_schema_type":"","jetpack_seo_llms_txt_always_include":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_wpcom_ai_launchpad_first_post":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"{title}\n\n{excerpt}\n\n{url}","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_wpas_customize_per_network":false,"jetpack_post_was_ever_published":false},"categories":[551],"tags":[3161,3159],"faq_section":[],"class_list":["post-154303","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-bpmn-icons","tag-microsoft-365-ja","tag-microsoft-onedrive-ja"],"jetpack_publicize_connections":[],"uagb_featured_image_src":{"full":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?fit=1200%2C675&ssl=1",1200,675,false],"thumbnail":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?resize=440%2C440&ssl=1",440,440,true],"medium":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?fit=560%2C315&ssl=1",560,315,true],"medium_large":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?fit=768%2C432&ssl=1",768,432,true],"large":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?fit=1024%2C576&ssl=1",1024,576,true],"1536x1536":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?fit=1200%2C675&ssl=1",1200,675,true],"2048x2048":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?fit=1200%2C675&ssl=1",1200,675,true],"newspack-article-block-landscape-large":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?resize=1200%2C675&ssl=1",1200,675,true],"newspack-article-block-portrait-large":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?resize=900%2C675&ssl=1",900,675,true],"newspack-article-block-square-large":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?resize=1200%2C675&ssl=1",1200,675,true],"newspack-article-block-landscape-medium":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?resize=800%2C600&ssl=1",800,600,true],"newspack-article-block-portrait-medium":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?resize=600%2C675&ssl=1",600,675,true],"newspack-article-block-square-medium":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?resize=800%2C675&ssl=1",800,675,true],"newspack-article-block-landscape-intermediate":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?resize=600%2C450&ssl=1",600,450,true],"newspack-article-block-portrait-intermediate":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?resize=450%2C600&ssl=1",450,600,true],"newspack-article-block-square-intermediate":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?resize=600%2C600&ssl=1",600,600,true],"newspack-article-block-landscape-small":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?resize=400%2C300&ssl=1",400,300,true],"newspack-article-block-portrait-small":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?resize=300%2C400&ssl=1",300,400,true],"newspack-article-block-square-small":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?resize=400%2C400&ssl=1",400,400,true],"newspack-article-block-landscape-tiny":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?resize=200%2C150&ssl=1",200,150,true],"newspack-article-block-portrait-tiny":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?resize=150%2C200&ssl=1",150,200,true],"newspack-article-block-square-tiny":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?resize=200%2C200&ssl=1",200,200,true],"newspack-article-block-uncropped":["https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?fit=1200%2C675&ssl=1",1200,675,true]},"uagb_author_info":{"display_name":"Shiho Tatsumi","author_link":"https:\/\/support.questetra.com\/en\/author\/tatsumi48c607ec82\/"},"uagb_comment_info":0,"uagb_excerpt":"This item moves the specified file\/folder to the specified folder on OneDrive. The file\/folder cannot be moved between drives.","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9DiIh-E8L","jetpack-related-posts":[{"id":96192,"url":"https:\/\/support.questetra.com\/en\/developer-blog\/onedrive-workflow-tutorial\/","url_meta":{"origin":154303,"position":0},"title":"Utilising OneDrive from Your Workflow","author":"Hirotaka NISHI","date":"2020-10-13","format":false,"excerpt":"We will describe some automated Tasks related to Microsoft 365 OneDrive for Business. Users can create folders and upload files to OneDrive.","rel":"","context":"In &quot;Questetra Developers Blog&quot;","block_context":{"text":"Questetra Developers Blog","link":"https:\/\/support.questetra.com\/ja\/category\/developer-blog\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/09\/OneDrive-1.png?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/09\/OneDrive-1.png?fit=1200%2C675&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/09\/OneDrive-1.png?fit=1200%2C675&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/09\/OneDrive-1.png?fit=1200%2C675&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2020\/09\/OneDrive-1.png?fit=1200%2C675&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":86658,"url":"https:\/\/support.questetra.com\/en\/bpmn-icons\/onedrive-folder-create\/","url_meta":{"origin":154303,"position":1},"title":"Microsoft 365 OneDrive for Business: Create Folder","author":"Shiho Tatsumi","date":"2024-01-16","format":false,"excerpt":"Creates a folder in the specified folder on OneDrive.","rel":"","context":"In &quot;BPMN Icons&quot;","block_context":{"text":"BPMN Icons","link":"https:\/\/support.questetra.com\/en\/category\/bpmn-icons\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?fit=1200%2C675&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?fit=1200%2C675&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?fit=1200%2C675&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?fit=1200%2C675&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":88766,"url":"https:\/\/support.questetra.com\/en\/bpmn-icons\/onedrive-file-copy\/","url_meta":{"origin":154303,"position":2},"title":"Microsoft 365 OneDrive for Business: Copy File \/ Folder","author":"Shiho Tatsumi","date":"2023-12-14","format":false,"excerpt":"This item copies the specified file\/folder to the specified folder on OneDrive.","rel":"","context":"In &quot;BPMN\u30a2\u30a4\u30b3\u30f3&quot;","block_context":{"text":"BPMN\u30a2\u30a4\u30b3\u30f3","link":"https:\/\/support.questetra.com\/ja\/category\/bpmn-icons\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?fit=1200%2C675&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?fit=1200%2C675&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?fit=1200%2C675&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?fit=1200%2C675&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":88837,"url":"https:\/\/support.questetra.com\/en\/bpmn-icons\/onedrive-file-delete\/","url_meta":{"origin":154303,"position":3},"title":"Microsoft 365 OneDrive for Business: Delete File \/ Folder","author":"Shiho Tatsumi","date":"2024-01-16","format":false,"excerpt":"Deletes files and folders on OneDrive. You can delete more than one at a time. When you delete multiple items, you should write one URL per line.","rel":"","context":"In &quot;BPMN Icons&quot;","block_context":{"text":"BPMN Icons","link":"https:\/\/support.questetra.com\/en\/category\/bpmn-icons\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?fit=1200%2C675&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?fit=1200%2C675&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?fit=1200%2C675&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?fit=1200%2C675&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":86175,"url":"https:\/\/support.questetra.com\/en\/bpmn-icons\/onedrive-file-upload\/","url_meta":{"origin":154303,"position":4},"title":"Microsoft 365 OneDrive for Business: Upload File","author":"Shiho Tatsumi","date":"2024-01-16","format":false,"excerpt":"This item uploads files to the specified folder on OneDrive.","rel":"","context":"In &quot;BPMN Icons&quot;","block_context":{"text":"BPMN Icons","link":"https:\/\/support.questetra.com\/en\/category\/bpmn-icons\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?fit=1200%2C675&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?fit=1200%2C675&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?fit=1200%2C675&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?fit=1200%2C675&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":75378,"url":"https:\/\/support.questetra.com\/en\/developer-blog\/onedrive-questetra\/","url_meta":{"origin":154303,"position":5},"title":"How to Output Files from Cloud-based Workflow Questetra to OneDrive","author":"Tsuyoshi Kusaka","date":"2019-03-06","format":false,"excerpt":"Summary of connection settings (file output) for Questetra BPM Suite to OneDrive","rel":"","context":"In &quot;Questetra Developers Blog&quot;","block_context":{"text":"Questetra Developers Blog","link":"https:\/\/support.questetra.com\/en\/category\/developer-blog\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2019\/03\/onedrive-questetra-1200x675-1.png?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2019\/03\/onedrive-questetra-1200x675-1.png?fit=1200%2C675&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2019\/03\/onedrive-questetra-1200x675-1.png?fit=1200%2C675&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2019\/03\/onedrive-questetra-1200x675-1.png?fit=1200%2C675&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2019\/03\/onedrive-questetra-1200x675-1.png?fit=1200%2C675&ssl=1&resize=1050%2C600 3x"},"classes":[]}],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/support.questetra.com\/wp-content\/uploads\/2021\/06\/bpmn-icon-service-task-one_drive.png?fit=1200%2C675&ssl=1","_links":{"self":[{"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/posts\/154303","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/comments?post=154303"}],"version-history":[{"count":5,"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/posts\/154303\/revisions"}],"predecessor-version":[{"id":154313,"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/posts\/154303\/revisions\/154313"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/media\/110810"}],"wp:attachment":[{"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/media?parent=154303"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/categories?post=154303"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/tags?post=154303"},{"taxonomy":"faq_section","embeddable":true,"href":"https:\/\/support.questetra.com\/en\/wp-json\/wp\/v2\/faq_section?post=154303"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}