web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Set target audience on...
Power Automate
Answered

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

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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.

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

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

  • v-yuazh-msft Profile Picture
    Microsoft Employee on at

    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

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    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?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 262 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 227

#3
Expiscornovus Profile Picture

Expiscornovus 225 Most Valuable Professional

Last 30 days Overall leaderboard