I have a workflow that creates a folder in my document library. It then copies any attachments from my list and dumps them in this newly created folder. Then the folder gets updated with the appropriate GROUP designation but I need the documents inside the folder to also get updated with this group designation from my list.
I guess I need to loop through the newly created folder to get the list of documents and then update the GROUP column. Can someone clue me in as to how to accomplish this?
Solved! Go to Solution.
You can do this by comparing the path property (FileDirRef) of the documents with the url path of the folder (FileRef). If they are equal, the documents are Inside the folder.
You can use a query list action to get the documents Inside the folder.
Hope this helps
From what I see, you have attachments in a list and you are copying the same attachments to a library. I don't know if I am understanding you correctly, but I wouldn't recommend doing this. Why? Because you have the same document in two locations and they may not be updated. So one may not get updated when the other one is. This is not good for Configuration Management. You should never have the same document in two different locations. Also, it is not recommended to use folders in SharePoint. It is better to either use Content Types, create a field or use different document libraries based on that type of document. So say they are inventory documents - you could either create a document library called 'Inventory', or a content type called
'Inventory' or a lookup with 'Inventory' as a value. This allows you to better utilize the SharePoint features and metadata.
The reason it is in two locations is because I send an email notification to the client with a link to the folder with the pertinent documents from the document library related to the task. There could also be more than one deliverable for a task so I wasn't about have multiple links in the email notification.
The plan is to have views created so that I can categorize the folders that get created and grant access to users specific to the appropriate views that contain all the documents or deliverable that relate to their business unit. I did not want to grant them access to the list. The folders are titled the same as the task name so I thought that may make it easier for a user to search since that metadata is also in the notification email.
I am not concerned with these documents getting updated, they are a one-time thing.
Perhaps having multiple document libraries isn't a bad idea but that means more workflows to separate them. I guess for archiving purposes this may be a better approach since some libraries may get larger than others. I will look into that.
That being said, do you have any input on the original question?
Sorry for the delay.
To get the path of the folder (this method will only work if the folder is not inside another folder), you can use a Query list action and configure it like the following :
To get the documents inside the folder, you can use a Query list action and configure it like the following :
<FieldRef Name="FileRef" />
<FieldRef Name="FileDirRef" />
Then, you can save the action and it should work.
Tell if it's not clear enough or if it doesn't work or if you're folder is inside another folder.