Skip to main content

Notifications

Power Automate - General Discussion
Answered

How to Extract Attribute value from JSON output

(0) ShareShare
ReportReport
Posted on 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
    godala_vamshi 174 on at
    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
    godala_vamshi 174 on at
    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
    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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

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

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,636

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,942

Leaderboard