cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Set target audience on items & documents with FLOW based off Meta-Data

I am trying to create a flow that updates a files target audience based off a piece of meta-data I assigned to the library. Specifically when the column 'audience'  on a file is set to public it adds the public SharePoint group to the target audience and vice versa when the 'audience' is set to team only, it adds the team SharePoint group to the target audience.

 

Here are the problems I ran into so far:

 

1. When users add a file to the new library using the new experience it just uploads the file without having to assign any meta-data to it, that off the bat ruins the flow.

2. When I switch to the classic view to get the old upload form back it still triggers the flow before meta-data is assigned to it because its already uploaded to the server.

 

So when an item is created trigger does not work properly.

 

The second set of problems I ran into understanding the trigger needs to be correct first but I don't see how I can create an iteration.

 

Some pseudo code to explain:

If Audience = 'public' set Target Audience (public sharepoint group)

else Audience = 'team only' set Target Audience (private sharepoint group)

 

Has anyone tried something similiar? Basically if there is a way to update a column based off another column I am hoping it will work. I also thought about looking into using powershell to do this if flow is not capable yet.

 

Thanks for any discusison about this.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Helper I
Helper I

Re: Set target audience on items & documents with FLOW based off Meta-Data

Hi v-yuazh-msft, thanks for taking the time to read my post.

 

The audience column in this case is just a choice column set to a radio button. I was trying to avoid having end users assign the target audience because it requires more clicking and knowledge of what groups to assign to the file.

 

What I did instead for now is I switched the library view in SharePoint online to classic, that makes the old style form appear so it is more clear what to fill out. Then I also restricted groups to just SharePoint groups for target audiences so they don't have to guess between global permissions, etc.

 

I did see someone submit the idea as a suggestion - hopefully it gains attention as auto-provisioning target audiences would be great for large amounts of files. Unless there is some way to write some custom code using powershell to perform this task? But if so how do you even upload a script to run in SharePoint online?

View solution in original post

3 REPLIES 3
Highlighted
Helper I
Helper I

Re: Set target audience on items & documents with FLOW based off Meta-Data

*Quick Edit* The trigger "When an item is created" does work properly just not for this specific use case.

Highlighted
Community Support
Community Support

Re: Set target audience on items & documents with FLOW based off Meta-Data

Hi @HelloWorld1,

 

Could you please share more details about the "audience" column in the sharepoint library, is it a "Person or group" type column in the library? or what is the type of the "audience"?

 

Yes, as you said, when work with microsoft flow currently, the flow with trigger "When a file is created" would be triggered when a file is created, and the file would be uploded without having to assign any meta-data to it.

 

If you want the flow would be triggered to upload the file after all meta-data having assigned, I afraid that there is no any way to achieve it, and you could consider submit an idea to flow flow idea forum so the function might be considered in the future release:

https://powerusers.microsoft.com/t5/Flow-Ideas/idb-p/FlowIdeas

 

Best regards,

Alice

Highlighted
Helper I
Helper I

Re: Set target audience on items & documents with FLOW based off Meta-Data

Hi v-yuazh-msft, thanks for taking the time to read my post.

 

The audience column in this case is just a choice column set to a radio button. I was trying to avoid having end users assign the target audience because it requires more clicking and knowledge of what groups to assign to the file.

 

What I did instead for now is I switched the library view in SharePoint online to classic, that makes the old style form appear so it is more clear what to fill out. Then I also restricted groups to just SharePoint groups for target audiences so they don't have to guess between global permissions, etc.

 

I did see someone submit the idea as a suggestion - hopefully it gains attention as auto-provisioning target audiences would be great for large amounts of files. Unless there is some way to write some custom code using powershell to perform this task? But if so how do you even upload a script to run in SharePoint online?

View solution in original post

Helpful resources

Announcements
firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Users online (10,764)