cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

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
Anonymous
Not applicable

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
Anonymous
Not applicable

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

v-yuazh-msft
Community Support
Community Support

Hi @Anonymous,

 

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

Anonymous
Not applicable

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?

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (2,764)