Question

Get photos from collection using Loop for Each and storing as Separate File Variables

  • 24 January 2024
  • 2 replies
  • 37 views

Badge +3

Hi, 

I cant see anything relating this query so figured it might help myself and other in the future if answered here.

I have a form with file upload action where 4 photos can be uploaded and stored in a SharePoint Doc Library.

Using a create a folder action, a new folder is being created with the Output result being saved as a collection variable (folder name).
I have a loop for each where they're being processed and set to a file data type. I then am saving these in the doc library. 

Next, I need to get the items from the collection and set individual variables, so I can use them to populate in my template document. As i also need the photos on the Generated Document.

Is there a way to use Loop for Each, rather than using multiple instances of Get Item from Collection for every individual photo? 

My issue is, loop for each doesn't have an index or Store Item options, which is needed for creating the Photo variables in the doc generation action.

Any help is greatly appreciated!


2 replies

Badge +8

 @MatthewSimmons , I am not aware of a way this can be done with a For-Each loop, because the Set Variable Value does not allow setting of Files (strangely enough), so I would say using the Get Item from Collection is the only way.

You can do that directly from the Attachment control (Which is a collection), no need to save it to SharePoint first.

 

Badge +3

Okay got it, Thanks for confirming that @Deon. Greatly appreciate it!

Reply