title: Azure Logic Apps - Moving Email Message with Move Message action
body: <p>I'm fairly new to Logic Apps and I have an app that I'm trying to get to move an email to a subfolder of the Inbox in a shared mailbox, but I'm trying to generate the path based on the date and I cannot for the life of me get it to work. I don't know if my path syntax is wrong or what.</p>
  
  <p>The subfolder structure is basically</p>
  
  <pre><code>- Inbox
   - 2018
    - Jan
    - Feb
    - Mar
    - Etc
  </code></pre>
  
  <p>And I'm trying to generate the path based off the year and the month using the Expressions part of a field. I've got an expression that generates the path for me </p>
  
  
  
  <pre class="lang-html prettyprint-override"><code>concat('Inbox\',formatDateTime(convertFromUtc(utcNow(),'Mountain Standard Time'),'MMM'),'\',formatDateTime(convertFromUtc(utcNow(),'Mountain Standard Time'),'yyyy'))
  </code></pre>
  
  
  
  <p>When the logic app runs this generates the correct path string of <code>Inbox\2018\Jan</code> but when the Move Email action runs it always escapes the backslash and then says it can't find the folder <code>Inbox\\2018\\Jan</code>.</p>
  
  <p>So I either have this format wrong, I can't put the email in a subfolder or there's another way to do this.</p>
  
  <p>I tried using the folder picker to pick one of the month subfolders and then peeked at the code and it uses some base64 encoded string for the path. I've pasted below what the peeked code shows</p>
  
  
  
  <pre class="lang-html prettyprint-override"><code>{
      "inputs": {
          "host": {
              "connection": {
                  "name": "@parameters('$connections')['office365']['connectionId']"
              }
          },
          "method": "post",
          "path": "/Mail/Move/@{encodeURIComponent(triggerBody()?['Id'])}",
          "queries": {
              "folderPath": "Id::AAMkADRmOTgyMDI1LThkODYtNDMwYy1iYThiLTIzODQwN2Y1OGMzYQAuAAAAAAA6K3dJssnITb8NwkAsBOo7AQBaJ9ZTcg-MSoOEUUjjUdOAAAAD0nvYAAA="
          },
          "authentication": "@parameters('$authentication')"
      },
      "metadata": {
          "Id::AAMkADRmOTgyMDI1LThkODYtNDMwYy1iYThiLTIzODQwN2Y1OGMzYQAuAAAAAAA6K3dJssnITb8NwkAsBOo7AQBaJ9ZTcg-MSoOEUUjjUdOAAAAD0nvYAAA=": "Jan"
      }
  }
  </code></pre>
  
  
  
  <p>Does anyone know how I would be able to move an email to a subfolder without using the folder picker?</p>
  
  <p>Edit: Since posting I've also tried using the following strings that also do not work</p>
  
  <pre><code>Inbox/2018/Jan
  Inbox:/2018/Jan
  /Inbox/2018/Jan
  </code></pre>