# Dynamic Excel Input step

**URL:** <https://community.automationedge.com/t/dynamic-excel-input-step/10949>\
**Category:** Process Studio\
**Tags:** rpa\
**Created:** [September 25, 2023, 6:27pm UTC](https://community.automationedge.com/t/dynamic-excel-input-step/10949 "2023-09-25T18:27:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kock03](https://avatars.discourse-cdn.com/v4/letter/k/ac91a4/32.png) [@Kock03](https://community.automationedge.com/u/Kock03)\
**Post date:** [September 25, 2023, 6:27pm UTC](https://community.automationedge.com/t/dynamic-excel-input-step/10949/1 "2023-09-25T18:27:20Z")

</div>

Hey everyone! I have a worfkflow that runs every 5 minutes, and saves a spreadsheet in a certain folder. How do I make an Excel input that always takes the last spreadsheet saved in this folder? Because I will need to consult this spreadsheet, but always the last one downloaded.

---

<div class="post-metadata">

**Author:** ![Jane](https://avatars.discourse-cdn.com/v4/letter/j/ecb155/32.png) [@Jane](https://community.automationedge.com/u/Jane)\
**Post date:** [September 26, 2023, 4:03am UTC](https://community.automationedge.com/t/dynamic-excel-input-step/10949/2 "2023-09-26T04:03:21Z")

</div>

Hi! Vinicius,

Please can you try Windows Automation for this to click on the topmost file.

---

<div class="post-metadata">

**Author:** ![Kock03](https://avatars.discourse-cdn.com/v4/letter/k/ac91a4/32.png) [@Kock03](https://community.automationedge.com/u/Kock03)\
**Post date:** [September 26, 2023, 1:03pm UTC](https://community.automationedge.com/t/dynamic-excel-input-step/10949/3 "2023-09-26T13:03:10Z")

</div>

I don’t understand, would you explain me again?

---

<div class="post-metadata">

**Author:** ![Jane](https://avatars.discourse-cdn.com/v4/letter/j/ecb155/32.png) [@Jane](https://community.automationedge.com/u/Jane)\
**Post date:** [September 27, 2023, 6:32am UTC](https://community.automationedge.com/t/dynamic-excel-input-step/10949/4 "2023-09-27T06:32:24Z")

</div>

Hi! Vinicius,

In File Explorer in a windows machine let us assume the latest file is at the top. So it has a fixed position.

Firstly, AutomationEdge has ready Windows GUI Automation actions to capture steps to be performed on a windows application and generate an RPA automation workflow. You can use this. Here is a video with an example for GUI Web+Windows automation - [https://youtu.be/XRPFswt4k0A](https://youtu.be/XRPFswt4k0A)  
And here is a playlist for GUI for Web Automation - [https://www.youtube.com/playlist?list=PLniM5YriMFVIgkgoKR\_APdBplfNP-S5yd](https://www.youtube.com/playlist?list=PLniM5YriMFVIgkgoKR_APdBplfNP-S5yd)

Secondly, is there a way you can identify the excel file by name? Then you can filter the file using the options in the highlighted box below.

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/automationedge/original/2X/0/03e6b774720f847cf4bc66cea4ca9d8e1e79b738.png)

---

<div class="post-metadata">

**Author:** ![Kock03](https://avatars.discourse-cdn.com/v4/letter/k/ac91a4/32.png) [@Kock03](https://community.automationedge.com/u/Kock03)\
**Post date:** [September 27, 2023, 5:46pm UTC](https://community.automationedge.com/t/dynamic-excel-input-step/10949/5 "2023-09-27T17:46:21Z")

</div>

Thank you so much Seema!

The second point i can’t doing that, because that’s files is saved after 5 minutes, in another workflow, so the lastest file is always changed. But isn’t there a step so I can identify the last file in the specific folder and then set it to my Microsoft Input Excel? I can retrieve the names of all my files using get files names, but I cannot set just the last one to my excel input.

---

<div class="post-metadata">

**Author:** ![Jane](https://avatars.discourse-cdn.com/v4/letter/j/ecb155/32.png) [@Jane](https://community.automationedge.com/u/Jane)\
**Post date:** [September 29, 2023, 4:49am UTC](https://community.automationedge.com/t/dynamic-excel-input-step/10949/6 "2023-09-29T04:49:43Z")

</div>

Hi! Vinicius,

You can use PowerShell or VBScript to find the latest downloaded filename. Concatenate the folder path (of the downloaded file) with the filename to use it in the MS Excel Input step.

---

<div class="post-metadata">

**Author:** ![Jane](https://avatars.discourse-cdn.com/v4/letter/j/ecb155/32.png) [@Jane](https://community.automationedge.com/u/Jane)\
**Post date:** [September 29, 2023, 4:55am UTC](https://community.automationedge.com/t/dynamic-excel-input-step/10949/7 "2023-09-29T04:55:39Z")

</div>

Hi! Vinicius,

Here is a sample code:

//Write Powershell script from here

# Get the last downloaded file.

$lastDownloadedFile = Get-ChildItem -Path “?{downloadpath}” -File | Sort-Object LastWriteTime -Descending | Select-Object -First 1

# Print the file name.

Write-Host “\<\<\>\>FieldName::$lastDownloadedFile\<\<\>\>”

#Replace downloadpath with path where latest file is download
