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

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Adding a new user to a certain Tag based on his Office Location

(0) ShareShare
ReportReport
Posted on by 14

Hello Comunity,

Im trying to create a power automate flow, which triggers on "when a user is added to a certain team". The flow is supposed to get the Profile from the User and read out the officeLocation. Than it should add the User to a tag, which has the same name as his office location (e.g. the user works in berlin, so he is added to the tag called "berlin".)
The flow is simple enough:

PowerAutomate.JPG

 

 

This runs into the following Error :

 

 

PowerAutomate2.JPG


After some trial and error, i figured out that the tag ID is indeed NOT the tag display name. If i choose the Tag manually, it would work, but this needs to get automated.
Here is a working example:

 

Powerautomate3.JPG

 

As you can see, the Raw Input is obviously not the same for the Tag ID. Can i somehow work around that? 
I figured something like: Get all Tags from the team -> Read out Tag ID's -> Match Tag Display Name with users officeLocation -> Convert users officeLocation into Tag ID -> Done. Is there a way to make this work? I was not able to figure it our. 
Thank you in advance!

I have the same question (0)
  • Verified answer
    Expiscornovus Profile Picture
    32,852 Most Valuable Professional on at
    Re: Adding a new user to a certain Tag based on his Office Location

    Hi @0carion,

     

    You could use the approach you suggested. List the tags, filter for the one which has the same displayName as the Office location and lookup the id of it.

     

    Below is an example.

     

    Use this expression as a custom value for the Tag id:

    first(body('Filter_array'))['id']

    officelocation_teamstag.png

  • 0carion Profile Picture
    14 on at
    Re: Adding a new user to a certain Tag based on his Office Location

    Hi @Expiscornovus  !

     

    Thank you for you very quick help!The flow seems to work, there are no errors and the outputs are correct. But the user is still not in the tag for some reason. Do you have an idea why thats happening? 

    PowerAutomate5.JPG


  • Expiscornovus Profile Picture
    32,852 Most Valuable Professional on at
    Re: Adding a new user to a certain Tag based on his Office Location

    Hi @0carion,

     

    The 200 response suggests that it should have worked. Maybe your Teams client is caching something and it is a timing issue?

     

    Have you tried it in Teams in the browser or otherwise signing out of the Teams Desktop client and signing back in to see if that makes a difference?

  • 0carion Profile Picture
    14 on at
    Re: Adding a new user to a certain Tag based on his Office Location

    I created a user called "TestTag", gave him the office Location "München" and created the Tag "München". After I built the flow, I added him to the team in teams in my browser. Singing in and out of my account did not work, and singing into the "TestTag" account also made no difference so far. BUT!
    I tried to build in a 2 minute delay between user Joining and grabbing his information and it worked! Thank you for your help!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 722 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 461 Moderator

#3
developerAJ Profile Picture

developerAJ 283

Last 30 days Overall leaderboard