StudioX - how to check if more than one file exists in folder(s)?

Hi,

Is there an option to check whether in a specific folder path (different path for each Excel row) more than one file exists? I need to fill in the data onto a portal and upload an attachment for each case, unfortunately only one file is accepted therefore I’d like to have a possibility to check first how many files exist in each folder location (there may be one or two, maximum three of them). Folder locations vary as they are specified in an Excel file which is connected to the automation.

Thanks a lot for your help!

@magdalena.b

Welcome to the community

Use a for each file in folder activity and send the folder path as input…

Inside that use a set variable activity and create counter variable with intial value or default value as 1 and inside the loop increment it using counter = counter +1

Outside the loop use if condition and check if counter >1

On the then side you will have multiple files and on else you will have 1 or none

Hope this helps

Cheers

Can you please specify how to set a variable activity and create counter variable with intial value or default value as 1 and inside the loop increment it using counter = counter +1 ?

Thanks a lot!

@magdalena.b

Create variable - Go to datamanager on right side panel …click create variable…give a name change type to number or integer and you will have field default value …give 0 there…Make sure scope is set to max sequence name

Set a variable - This is an activity in the activities panel…search for it…place it in the for each file in folder…on left side give counter and on right give counter + 1 …you can click on plus and click on open advanced editor to provide or type the values

cheers

I don’t see the Set a variable activity in the activities panel. I don’t have the Create variable option on the Datamanager panel in StudioX either :frowning: Can you please provide me with a screenshot? Or is there another way to set it?

Thanks a lot for your help once again <3

@magdalena.b

Please check this

create variable -

Set variable -

Hope this helps

cheers