cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TMC
Frequent Visitor

Parse JSON output into a usable string

Hi,

My objective is to retreive and display two fields (webLink and toRecipient:name) from a emails in a shared mailbox to be used in an HTML table. How do I get the value of toRecipients:name - just the name?

 

Thanks,

 

Terry

 

Right now this is what I get:

 

"to": [
{
"emailAddress": {
"name": "XXXXXXXXX",
"address": "XXX@XXX.com"
}
}

I'm using the graph to retreive the values and this is the schema:

{
    "type": "object",
    "properties": {
        "@@odata.context": {
            "type": "string"
        },
        "@@odata.nextLink": {
            "type": "string"
        },
        "value": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "@@odata.etag": {
                        "type": "string"
                    },
                    "id": {
                        "type": "string"
                    },
                    "webLink": {
                        "type": "string"
                    },
                    "toRecipients": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "emailAddress": {
                                    "type": "object",
                                    "properties": {
                                        "name": {
                                            "type": "string"
                                        },
                                        "address": {
                                            "type": "string"
                                        }
                                    }
                                }
                            },
                            "required": [
                                "emailAddress"
                            ]
                        }
                    }
                }
            }
        }
    }
}

graph.png.jpgselect.jpg

 

2 REPLIES 2
v-yamao-msft
Community Support
Community Support

Hi @TMC,

 

You may take the following blog USING JSON IN MICROSOFT FLOW for a reference:

https://sergeluca.wordpress.com/2017/11/23/using-json-in-microsoft-flow-part-1/

I assume that you could configure the code to something like:

Item()?['toRecipients']?['name']

 Hope it could be your reference.

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
TMC
Frequent Visitor

Mabel, Thank you for the suggestion.

 

I tried Item()?['toRecipients']?['name'] and received this error:

ExpressionEvaluationFailed. The execution of template action 'Apply_to_each_2' failed: the result of the evaluation of 'foreach' expression '@Item()?['toRecipients']?['name']' is of type 'Null'. The result must be a valid array.

Can you identify what I'm doing wrong?

 


Annotation 2019-01-29 105517.jpg

Thanks,

Terry

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,129)