title: How to get contents of a single file uploaded via Microsoft Forms using 'File Identifier'?
body: <p><strong>Desired Behaviour</strong></p>
  <ol>
  <li>Upload file using Microsoft Forms</li>
  <li>Get file content</li>
  <li>Create new file in new location</li>
  <li>Delete original file</li>
  </ol>
  <p><strong>Actual Behaviour</strong></p>
  <p>I am getting error at step 2:</p>
  <pre><code>&quot;body&quot;: {
      &quot;status&quot;: 404,
      &quot;message&quot;: &quot;File not found\r\nclientRequestId: yadda-yadda\r\nserviceRequestId: yadda-yadda&quot;
  }
  </code></pre>
  <p><strong>What I've Tried</strong></p>
  <p>In the Power Automate flow, the trigger is:</p>
  <p><a href="https://docs.microsoft.com/en-us/connectors/microsoftforms/#when-a-new-response-is-submitted" rel="nofollow noreferrer">When a new response is submitted</a></p>
  <p>The next action is:</p>
  <p><a href="https://docs.microsoft.com/en-us/connectors/microsoftforms/#get-response-details" rel="nofollow noreferrer">Get response details</a></p>
  <p>The <code>Raw Outputs</code> of this last action is essentially:</p>
  <pre><code>&quot;body&quot;: {
      &quot;responder&quot;: &quot;me@domain.com&quot;,
      &quot;submitDate&quot;: &quot;7/5/2021 3:17:56 AM&quot;,
      &quot;my-text-field-01&quot;:  &quot;text string here&quot;,
      &quot;my-file-upload-field-01&quot;:  [{.....}],
      &quot;my-file-upload-field-02&quot;:  [{.....}],
      &quot;my-text-field-02&quot;:  &quot;text string here&quot;
  }
  </code></pre>
  <p>The file upload fields have this schema:</p>
  <pre><code>{
      &quot;name&quot;: &quot;My File Name_Uploader Name.docx&quot;,
      &quot;link&quot;: &quot;https://my-tenant.sharepoint.com/sites/my-team-site/_layouts/15/Doc.aspx?sourcedoc=%7B0F1C3107-32C9-4CEF-B4BA-87E57C9DC514%7D&amp;file=My%20File%20Name_Uploader%20Name.docx&amp;action=default&amp;mobileredirect=true&quot;,
      &quot;id&quot;: &quot;01NSAULIQHGEOA7SJS55GLJOUH4V6J3RIU&quot;,
      &quot;type&quot;: null,
      &quot;size&quot;: 20400,
      &quot;referenceId&quot;: &quot;01NSAULISZJG7M56NSV5AIDUQFHG3BOBCH&quot;,
      &quot;driveId&quot;: &quot;letters-and-numbers-here&quot;,
      &quot;status&quot;: 1,
      &quot;uploadSessionUrl&quot;: null
  }
  </code></pre>
  <p>Strangely, the <code>id</code> or <code>referenceId</code> values in this object do not correspond with the <code>Document ID</code> that is displayed when looking at the document's properties in the SharePoint document library:</p>
  <p><a href="https://i.stack.imgur.com/Wt7bJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Wt7bJ.png" alt="enter image description here" /></a></p>
  <p>Anyhow, I can target the uploaded file properties with these expressions in the flow:</p>
  <pre><code>json(body('Get_response_details')?['random-letters-and-numbers'])[0]['name']  
  json(body('Get_response_details')?['random-letters-and-numbers'])[0]['driveId']  
  json(body('Get_response_details')?['random-letters-and-numbers'])[0]['id']  
  </code></pre>
  <p>The next action I want to take is <code>Get file content</code>.</p>
  <p>It seems this can be done via the following actions:</p>
  <p><em>SharePoint Connectors</em><br />
  <a href="https://docs.microsoft.com/en-us/connectors/sharepointonline/#get-file-content" rel="nofollow noreferrer">Get file content</a><br />
  <a href="https://docs.microsoft.com/en-us/connectors/sharepointonline/#get-file-content-using-path" rel="nofollow noreferrer">Get file content using path</a></p>
  <p><em>OneDrive for Business Connectors</em><br />
  <a href="https://docs.microsoft.com/en-us/connectors/onedriveforbusiness/#get-file-content" rel="nofollow noreferrer">Get file content</a><br />
  <a href="https://docs.microsoft.com/en-us/connectors/onedriveforbusiness/#get-file-content-using-path" rel="nofollow noreferrer">Get file content using path</a></p>
  <p>I'd like to use <code>Get file content</code> (as it seems more dynamic than having to pass through a hardcoded path).</p>
  <p>Several posts suggest the value I pass through to this action as the <code>File ID</code> should be a concatenation of <code>driveId</code> and <code>id</code>, ie:</p>
  <p><code>driveId</code>.<code>id</code></p>
  <p>Sources:<br />
  <a href="https://powerusers.microsoft.com/t5/Building-Flows/Move-rename-a-file-submitted-in-a-Microsoft-Form/td-p/438299" rel="nofollow noreferrer">Move, rename a file submitted in a Microsoft Form</a><br />
  <a href="https://powerusers.microsoft.com/t5/Building-Flows/Working-with-files-from-the-Forms-quot-File-Upload-quot-question/m-p/427353#M49836" rel="nofollow noreferrer">Working with files from the Forms &quot;File Upload&quot; question type</a></p>
  <p>However, when I try the following:</p>
  <p><a href="https://i.stack.imgur.com/o3J7H.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/o3J7H.png" alt="enter image description here" /></a></p>
  <p>I get the error:</p>
  <pre><code>&quot;body&quot;: {
      &quot;status&quot;: 404,
      &quot;message&quot;: &quot;File not found\r\nclientRequestId: yadda-yadda\r\nserviceRequestId: yadda-yadda&quot;
  }
  </code></pre>
  <p><strong>Question</strong></p>
  <p>What should I be passing into <code>Get file content</code> as the <code>File Identifier</code>?</p>
  <p><strong>Edit 1</strong></p>
  <p>After reading <a href="http://vipulkelkar.blogspot.com/2018/10/get-file-content-file-identifier-and.html" rel="nofollow noreferrer">this</a>, perhaps <code>File Identifier</code> actually refers to a 'file path', ie:</p>
  <pre><code>/Shared Documents/Apps/Microsoft Forms/My Form Name/Question/My File Name.docx
  </code></pre>
  <p>Ergh, I tried the path above as the <code>File Identifier</code> (by using the UI to manually select the file) and it works - not sure how I can create it dynamically as passing in a dynamic file name does not work:</p>
  <pre><code>/Shared Documents/Apps/Microsoft Forms/My Form Name/Question/@{variables('file_upload_wor_document_name')}
  </code></pre>
  <p><strong>Edit 2</strong>
  The last code snippet works as <code>File Identifier</code> when using SharePoint's <a href="https://docs.microsoft.com/en-us/connectors/sharepointonline/#get-file-content-using-path" rel="nofollow noreferrer">Get file content using path</a> connector.</p>
  <p>Would still appreciate any clarification on all the different types of <code>id</code> that are referred to in SharePoint/Power Automate/MS Graph etc and why <code>driveId</code>.<code>id</code> was suggested as the value to use in some places.</p>
  <p>I am finding not having access to the relevant file <code>id</code> at different times is problematic, eg the <a href="https://docs.microsoft.com/en-us/connectors/sharepointonline/#delete-file" rel="nofollow noreferrer">Delete file</a> action requires <code>File Identifier</code> to delete the file uploaded to Microsoft Forms - and I don't have access to that from the <a href="https://docs.microsoft.com/en-us/connectors/microsoftforms/#get-response-details" rel="nofollow noreferrer">Get response details</a> response.</p>