First post here, so please ask extra explanation is needed.
I have a flow which sends a http request to sharepoint to return some meta data on a document library (focus on ComplianceTag (which shows which retention label is applied))
Following the Parse JSON, I'm able to correctly compose what the retention label is. The next step, is that I want to populate a new column named 'Retention Period', where I have mapped each retention label to a period.
For example:
Retention Label: "Meetings (Team/Service)",
Retention Period: "6 years after date created"
I've initialized a variable called RetentionLabelMappings, which has this setup:
[
{
"label": "Guides & Templates",
"value": "Date Superseded"
},
{
"label": "Meetings (Team/Service)",
"value": "6 years after date created"
},
{
"label": "Meetings (Working Groups)",
"value": "10 years after date created"
}
]
How do I successfully retrieve the retention label/compliance tag and then map the label to the period?
I've tried a filter array but I don't seem to get it working.
This is the current flow, with the hope that after the final compose, I can store the retention label in a variable and use the Update file action in Sharepoint to update the column value.
Any ideas?
In applyToEach Action, since the input is the initialized variable which is your array, inside the loop when you try to display item()?['label'] or item()?['value'], this will return the current value for the key in this current item.
I hope I've good explained, maybe.
TLDR: I've got some meta data from a document library (what the value of a files retention label is set to), and want to update a 'Retention Period' column based on the retention label value. I.e if the retention label column value is set to Internal Projects, the Retention Period will be set to 6 years.
The flow currently successfully returns the retention label value for each file, but I'm having trouble mapping the label to the retention period that I set in an array variable.
Michael E. Gernaey
497
Super User 2025 Season 2
David_MA
436
Super User 2025 Season 2
Riyaz_riz11
244
Super User 2025 Season 2