logic app: compose - get the second value

Alon Keilin 141 Reputation points
2022-07-17T09:33:01.603+00:00

Hi guys,
I have an output that contains 2 arrays.

The IPs are under the fields: "Address" or "FriendlyName"
221486-screenshot-2022-07-17.png

How can I create a "compose" that get the second IP? (The 83...)
What expression I have to use?
I made "For_each" on the array "IPs" and then i created a "compose" which I inserted the input "items('For_each')?[Address], but it gets only the first IP (The 93...)
I know that I need to use 1 somewhere and it supposed to referred the second array but I don't know how use it properly.

Thanks

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
0 comments No comments
{count} votes

Answer accepted by question author
  1. Kamlesh Kumar 3,871 Reputation points
    2022-07-17T16:54:19.537+00:00

    Hi @AlonKeilin-9495 ,

    Welcome to Microsoft Q&A Platform. Thank you for the question.

    You can achieve it using Parse Json and the using the below expression condition get the value of second value of friendlyName

    body('Parse_JSON')?['body']?['Ips'][0]?['friendlyName']  
    

    221613-image.png

    Result

    221614-image.png

    Regards,
    Kamlesh Kumar
    BizTalk Techie

    Please don't forget to click on 205836-130616-image.png or upvote 205759-130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is How

    Want a reminder to come back and check responses? Here is how to subscribe to a Notification

    If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators


1 additional answer

Sort by: Most helpful
  1. David Broggy 6,776 Reputation points MVP Volunteer Moderator
    2022-07-17T09:46:04.657+00:00

    Hi Alon Keilin,
    My suggestion would be to do a parse json first so that your IPs array has been extracted.
    The fact that you say it’s only getting the 93 tells me the field/value is not recognized.
    (Also you mention 93 but that’s not shown in your example?)


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.