title: Power Automate how to get the latest file in a folder?
body: <p>I found this site answering my query but the answer is for UiPath not Power automate. Is there a way to implement that code in Power Automate?</p>
  <p><a href="https://i.stack.imgur.com/1BLgY.png" rel="nofollow noreferrer">Power Automate screenshot</a></p>
  <p><a href="http://microsoftrpa.com/get-latest-file-in-folder/" rel="nofollow noreferrer">http://microsoftrpa.com/get-latest-file-in-folder/</a></p>
  <pre><code>GetFiles(folder_path,&quot;.xlsx&quot;,SearchOption.AllDirectories).OrderByDescending(Function(d) New FileInfo(d).CreationTime).Tolist(0)
  </code></pre>