cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
dbs1crew
Level: Powered On

Pull the second URL from JSON array

Hey All,

TLDR version: I'm trying to pull the second URL from this JSON array.

JSON.png

 

[{"Type":"WebLink","Category":null,"Label":"Cloud App Security policy ID","Href":"hXXps://somecompany.portal.cloudappsecurity.com/#/policy/?id=eq(5g31deflcd715a4def2c82a0,)","LinkType":"POLICY"},{"Type":"WebLink","Category":null,"Label":"Cloud App Security alert ID","Href":"hXXps://somecompany.portal.cloudappsecurity.com/#/alerts/5e363y64650c7b04784a8e5b","LinkType":"ALERT"}]

 

I am creating policies in Cloud App Security that will generate tickets on our service board. I have already figured out creating the ticket. The last thing I want to add to the ticket is the URL (hXXps://somecompany.portal.cloudappsecurity.com/#/alerts/5e363y64650c7b04784a8e5b) that points to what triggered the alert. Right now I am using the Dynamic Content generated from Cloud App Security called Extended Links (JSON Array above). I used the Generate from sample option. Here is my current flow setup and where I would want to put the URL in the ticket.

Setup.png

Ticket.png

 

I would appreciate any assistance or input. Even if it means doing it a completely different way haha

2 REPLIES 2
Dual Super User
Dual Super User

Re: Pull the second URL from JSON array

Hi
Let's assume you store your JSON array in a array type variable called currentJSONarray by means of 'Initializa variable' action block
In order to get the content of the Href property of the last JSON item I would try the following expressions:

json(last(variables('currentJSONarray')))?['Href']

or

last(variables('currentJSONarray'))?['Href']

Hope this helps


Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Dual Super User
Dual Super User

Re: Pull the second URL from JSON array

@dbs1crew 

Did you finally solve the issue?

Thanx!



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Helpful resources

Announcements
firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,421)