Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - General Discussion
Answered

How to Extract Attribute value from JSON output

Like (0) ShareShare
ReportReport
Posted on 28 May 2024 18:32:20 by 174

Hello, 

 

I have a JSON output from a source each time with multiple objects that have several attributes, each defined by an objectTypeAttribute object. I'm trying to extract the particular value of an objectTypeAttributeId 926, which should be 386 for this example, and use that value for a condition. As we have multiple objects with the same name, objectTypeAttributeId and value, what is the best way to extract it? Thank you for your help in advance. 

 

godala_vamshi_0-1716921112525.png

 

 

 

 

  • godala_vamshi Profile Picture
    174 on 31 May 2024 at 22:19:32
    Re: How to Extract Attribute value from JSON output

    @v-xiaochen-msft  I just notice you passed 'objectTypeAttributeValues' in Array on your example but JSON response I'm working with will have multiple objects in below format and I don't see objectTypeAttributeValues in my JSON. 
    {
    "workspaceId": "21b184a3-5411-4d4c-a9af-dcf7fb6c792d",
    "globalId": "21b184a3-5411-4d4c-a9af-dcf7fb6c792d:121231",
    "id": "121231",
    "objectTypeAttribute": {
    "workspaceId": "21b184a3-5411-4d4c-a9af-dcf7fb6c792d",
    "globalId": "21b184a3-5411-4d4c-a9af-dcf7fb6c792d:926",
    "id": "926",
    "name": "ID",
    "label": false,
    "type": 0,
    "description": "",
    "defaultType": {
    "id": 0,
    "name": "Text"
    },
    "editable": true,
    "system": false,
    "sortable": true,
    "summable": false,
    "indexed": true,
    "minimumCardinality": 0,
    "maximumCardinality": 1,
    "removable": true,
    "hidden": false,
    "includeChildObjectTypes": false,
    "uniqueAttribute": false,
    "options": "",
    "position": 0
    },
    "objectTypeAttributeId": "926",
    "objectAttributeValues": [
    {
    "value": "2013",
    "displayValue": "2013",
    "searchValue": "2013",
    "referencedType": false
    }
    ],
    "objectId": "2378"
    }

  • godala_vamshi Profile Picture
    174 on 29 May 2024 at 04:34:06
    Re: How to Extract Attribute value from JSON output

    @v-xiaochen-msft Thank you for your time on this. I have tried your suggestion but the compose output coming as blank. 
    I have also tried other way but still coming as blank. 

    godala_vamshi_0-1716956999001.png

    godala_vamshi_1-1716957092085.png

     

    godala_vamshi_2-1716957202148.png

     

  • Verified answer
    v-xiaochen-msft Profile Picture
    on 29 May 2024 at 02:13:46
    Re: How to Extract Attribute value from JSON output

    Hi @godala_vamshi ,

     

    Please try this

    vxiaochenmsft_0-1716948784836.png

    item()?['objectTypeAttributeId']
    string(926)
    body('Filter_array')?[0]?['objectTypeAttributeValues']?[0]?['value']
     
    vxiaochenmsft_1-1716948818149.png

     

     

    Best Regards,

    Wearsky

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

Thomas Rice – Community Spotlight

We are honored to recognize Thomas Rice as our March 2025 Community…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,508 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,369 Most Valuable Professional

Leaderboard