Home > Net >  `ąLogic App - Expression to get a particular substring from a json
`ąLogic App - Expression to get a particular substring from a json

Time:03-22

I have out form one of the tasks in Logic App:

{
"headers": {
    "Connection": "close",
    "Content-Type": "application/json"
},
"body": {
    "systemAlertId": "....",
    "endTimeUtc": null,
    "entities": [
        {
            "$id": "us_1",
            "hostName": "...",
            "azureID": "someID",
            "type": "host"
        },
        {
            "$id": "us_2",
            "address": "fwdedwedwedwed",
            "location": {
                "countryCode": "",
            },
            "type": "ip"
        },
    ], 
}
}

I need initialize some variable named resourceID that contains value someID which is read from above example.

Value someID will always be found in the first member of Entities array, in that case I guess need to use function first

Any idea how expression of Initial variable should look?

Thanks

CodePudding user response:

Have a look at the enter image description here

enter image description here

and now you can initialize the resourceID using 'Initialise variable' connector and set its value to azureID as per your requirement.

enter image description here

  • Related