Solved

Query list action - I need all files within a known folder

  • 14 August 2020
  • 8 replies
  • 357 views

Badge +5

Hi guys,

 

I need your help for a list workflow in SharePoint Online which is able to query a folder with a unique name inside a library, which shouldn't have any subfolders, only documents in it.

 

As result I would like to have all the documents (URLs of those documents in a collection variable would work) which are in the subfolder "XYZ".

 

Can anybody help me out with this?

icon

Best answer by ohrenstoepsel 25 September 2020, 12:24

View original

8 replies

Badge +5

Ok, I managed to solve it myself using some tips from the community. Attached you can find a component workflow which does the job for me for 10 possible attachments in each folder.

Badge +2

Can you show a picture how you have done it?
I could not import that workflow to our server workflows.


There nwp does not work.


 


Thank you


Dagmar

Badge +5

I attached all workflow actions in numbered screenshots. I hope this helps. If not just ask your questions. Remember I use it as a component workflow on my main workflow to keep things tight. That's maybe the reason you cannot import my nwp-file because in an Office 365 Tenant this should work...

Badge +2

Thank you
I will try that 🙂

Badge +1

Can you please share your workflow? Somehow, I can’t look at the images that you share. It shows me blank. I also need to get all the files in the SharePoint Online folder and email out all the files as attachments. Thank you in advance.

Badge +1

@ohrenstoepsel Can you please show me how you do this? I need to get all my files in the SharePoint folder and attach them to an email. Thanks.

Badge +3

So I haven’t figured out how to query files in a folder, but figured out a work around if you are also storing those files into a folder in your workflow.  

I created a text column in my document library which I named Workflow ID.  

After I save the files to the folder in my workflow, using the stored file itemID, I set the Workflow ID column to the workflow instance id context variable.  

My query a list action then queries the Workflow ID column where it equals the workflow instance id context variable.

Hope this helps a few people.

Badge +1

@anissa_divincen Thanks for your reply. I had figured out the same way as you are. I added a column with my folder’s name, and when I query the files, I just added a condition. Everything works as I expected. Thanks again.

Reply