Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Delete files using Run Command

alt_tush
9 - Comet

Hi,

 

I have below list of files saved in C: drive

 

C:\MyFiles\File1_AU.xlsx

C:\MyFiles\File1_HK.xlsx

C:\MyFiles\File1_SN.xlsx

C:\MyFiles\File1_IN.xlsx

C:\MyFiles\File1_UK.xlsx

C:\MyFiles\File1_US.xlsx

C:\MyFiles\File1_SP.xlsx

C:\MyFiles\File1_FR.xlsx

C:\MyFiles\File1_BL.xlsx

 

I want to delete specific files based on selection of countries from list box. I have developed the list box.

Only i stuck where i want to delete specific files from list of the files using Run command.

 

If i select HK,IN,US,FR then only those files should delete where file name contains this country code.

 

Appreciate your help.

 

Thank you,

3 REPLIES 3
Luke_C
17 - Castor

Hi @alt_tush 

 

Here's an example, just update the text input with a directory tool (might need to tweak some formulas referencing the file path field). This should dynamically filter and create the command to delete a file. 

 

Luke_C_0-1678555011740.png

 

 

BS_THE_ANALYST
13 - Pulsar

@Luke_C not sure if you've spotted with the list box before but rather than manually feeding in those values for the listbox, you can take them from the data stream directly. I only learned this yesterday from a weekly challenge 😂

BS_THE_ANALYST_0-1678556637763.png

 

 

 

Luke_C
17 - Castor

@BS_THE_ANALYST Yes good call, it'd be good to get those dynamically for this use case - I was just mocking something up quick 😁

Labels