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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Extract Term Set ID fr...
Power Automate
Unanswered

Extract Term Set ID from HTTP output

(0) ShareShare
ReportReport
Posted on by 86

I have a flow that is triggered from an app.  When a new item is created in the App, the flow creates a new Term Set Value.  The next part that I'm having trouble with is updating a Sharepoint list item with this new managed Metadata term store value. 
Using a Send HTTP Sharepoint Get method 

CateR_0-1715920435666.png

I have retrieved the relevant Term Store record:

CateR_1-1715920532731.png

How can I extract the id value from above so that I can use this (together with the label which is already the variable TermValue ie: "TermValue|<extracted term id value >") to update a managed metadata column type in a sharepoint list? 

I've tried using Filter Array, Compose, Initialise variable - I can't figure out how to do it, if it is indeed possible?

 

Below if the full flow for context:

the TermValue is a parameter from the PowerApp, the Term Group ID and TermSetID are hardcoded.  I'm looking for a solution to go after the Get TermStore step to use in the Update Item step.    

 

CateR_2-1715921008981.png

 

Also for context the step to create the Term Store record 

CateR_3-1715921206441.png

 

Categories:
I have the same question (0)
  • BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @CateR ,

     

    Insert a Parse JSON action in your flow using this guide: Power Automate Parse JSON Action Guide | When & How To Use (zeitgeistcode.com)

  • Expiscornovus Profile Picture
    33,189 Most Valuable Professional on at

    Hi @CateR,

     

    In addition to @BCBuizer his approach you can also use an expression to retrieve the id of the single item returned. Just use an index to refer to that first item in the value array.

     

    Try the below expression:

     

    body('Get_TermStore')['value'][0]['id']

     

  • CateR Profile Picture
    86 on at

    Hi @BCBuzier,

    I have added Parse JSON function as per your suggestion.  It is returning similar output to the GET Http request in earlier step.  I don't know what to do next to just get the id value

    CateR_0-1716162688394.png

     

     

  • CateR Profile Picture
    86 on at

    Hi @Expiscornovus ,

    Can you please provide more specific details - is this expression for a filter array?  and how do I "just use an index to refer to that first item"

     

     

  • Verified answer
    Expiscornovus Profile Picture
    33,189 Most Valuable Professional on at

    Hi @CateR,

     

    You can use that expression directly in an action, in your case the Update Item action.

     

    In my sample I have already added the index for you, the index I used is: [0] (which refers to the first item).

     

    An index always start counting at 0, the second item would be [1], the third item [2], etc.

     

    Below is an example in a Compose action

     

    composeaction.png

     

     

  • Verified answer
    CateR Profile Picture
    86 on at

    thankyou @Expiscornovus this works really well!

  • CateR Profile Picture
    86 on at

    Hello @Expiscornovus,  I have encountered a problem - if a user creates a term store value that has an apostrophe ie: '  - this flow fails at the Get Term Store stage. I have tried without success to wrap the TermValue variable in double quotations for example changing the URI string to this : 

    CateR_1-1718754813076.png

    where currently it is like this:

    CateR_0-1718754765071.png

    Most appreciated if you have a solution

  • Verified answer
    Expiscornovus Profile Picture
    33,189 Most Valuable Professional on at

    Hi @CateR,

     

    You can escape it with another ' character.

     

    Lets say I am searching for D'Origine. In that case the TermValue needs to be D''Origine.

     

    You can use a replace function for this:

    replace(variables('TermValue'), '''', '''''')

     

    The whole URI would be:

    _api/v2.1/termStore/groups/@{variables('TermGroupId')}/sets/@{variables('TermSetId')}/terms?$filter=labels/any(a: a/name eq '@{replace(variables('TermValue'), '''', '''''')}')

     

    apostrophe_replace.png

  • CateR Profile Picture
    86 on at
    thank you so much!
  • CateR Profile Picture
    86 on at
    Please help!
    another question about the solution provided below:
    replace(variables('TermValue'), '''', '''''')
    to filter out use of apostrophe's  - how can I do this to filter out use of symbols - in particular: &
    If my term Store label includes a & symbol the flow fails at this point
     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard