Hi,
I have a Sharepoint Document Library that has the following:
- Custom Columns that are linked to Managed Metadata based on a term store, all columns allow multiple selections:
- Subject
- Document Type
- Internal Counterparty
- External Counterparty
- 4 Folders:
- General
- Admin
- Compliance
- Regulation
- The 4 folder names above are contained in the term store under subject
I am trying to create a flow that does the following:
- On file creation or modification
- Checks that the subject column, contains the relevant tag for the folder it is in, for example if the file is in Admin, one of the tags in the subject column should be 'Admin'
- If it doesn't have that tag then auto tag it based on the folder name
My current flow is:
When item created or modified (properties) [Sharepoint]
Get file properties [Sharepoint]
Initialise Variables [Variable] - one for each Column
Append to Arrays [Variable] - takes column current values and appends to each variable
Update file properties [Sharepoint] - updates each column with the array variable
I have got close in creating this but the issue I have is as follows:
- If I am not updating other columns do I need to create variables for each (all columns are required columns) as it seemed to require entries in the update file properties for each required column, even if not being updated.
- How do I get it to use the folder name as the tag ie for example 'admin', I have seen in folder path property it brings the root folder as well ie 'Shared Documents/Admin/'
- How do I then build a condition that checks if it already contains the tag as there could be multiple tags? (otherwise could get stuck in a loop)
- The fact subject is based on managed metadata that can have multiple entries seems to be an issue, as the relevant tag seems to need to be appended as an array with a code for example:
- This seems to work as a code, but if I am using the folder name, how would it know the code relevant to the term store item. Eg in example the bold bit below..
{
"Value": "Admin|2c0225f2-0c21-413a-b8c7-d589c59a5599"
}
Hope this makes sense?
Cheers
J