web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Parse out URLS from JS...
Power Automate
Unanswered

Parse out URLS from JSON String

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I am trying to parse a JSON string for multiple URLS in the below text from "HTTPS" to the ",". I have code working that grabs the first URL perfectly but I am unsure how to loop through and get all the URLS separated out.

ParseJSONforURLS.png

Looking for four links formatted like this
https://m365x500140.sharepoint.com/sites/Mark8ProjectTeam/_layouts/15/Doc.aspx?sourcedoc=%7BB39CCDF3-CB49-45FA-A8F4-A8ECDCCAFF69%7D&file=Dcoument1_Jessie%20Pinkerton.docx&action=default&mobileredirect=true

 

Categories:
I have the same question (0)
  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @Steve0 

     

    You want to use a select action. Make sure you turn on text mode for the select and insert the dynamic value for link. It will return and array of links. 

    Damien

  • Verified answer
    Steve0 Profile Picture
    Microsoft Employee on at

    Here is how I solved it for others to leverage

    GetFormFileLinks.png

  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @Steve0 

     

    Just an observation, looks like you're creating markdown, maybe for PVA?  You don't need the HTML to Text step as it removes HTML tags <br> <table> etc from raw HTML.  You are simply dealing with values from an object, which are already text strings in your case.

     

    There is actually a post from this week about achieving this in PVA Solved: Re: PVA Return Sharepoint Files unable to Return I... - Power Platform Community (microsoft.com)

     

    The select method I mentioned would look as follows:

     

    DamoBird365_0-1651824141887.png

     

    The output of the select gives you an array of names and links in the markdown format and then you use join() to bring those objects together as a string.

     

    DamoBird365_1-1651824258843.png

    If you want to add a return line to the string, you can join on decodeUriComponent('%0A').  The attached post also shows you how to bullet mark the list - if that's what you are looking for.

     

    I noticed whilst testing this that PowerAutomate will sneakily remove the " " on the select when you return to the flow to edit.  The alternative to the screenshot I have provided is to construct a concat.

     

    DamoBird365_2-1651824624719.png

    Concat('[',item()?['{Name}'],'](',item()?['{Link}'],')')

    broken down that is:

     

    Concat('[', //opening square bracket

    item()?['{Name}'], //file name

    '](', //closing square bracket and opening bracket

    item()?['{Link}'], //file link

    ')') //closing bracket

     

    Hope that helps with understanding - even if it's not used for your solution right now 🙂

     

    Damien

    Please take a look and subscribe to my YouTube Channel for more Power Platform ideas and concepts

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard