none
Get WordPress post image URL using SharePoint online MS flow. RRS feed

  • Question

  • Hi, i want get image URL from particular WordPress post.

    So i have used WordPress connector "When post is created". but it is not giving the image URL of particular post.

    MS flow of WordPress

    {  "ID": 25,
      "site_ID": ,
      "author": {
        "ID": , "login": "", "email": ,"name": "", "first_name": "", "last_name": "", "nice_name": "ab",
        "URL": "", "avatar_URL": "",
        "profile_URL": "",  "site_ID": 
      },
      "date": "2020-01-08T10:38:53+00:00",
      "modified": "2020-01-08T10:38:53+00:00",
      "title": "SharePoint Office 365",
      "URL": "http://sharepoint.photo.blog/2020/01/08/sharepoint-office-365/",
      "short_URL": "https://wp.me/pbAy4E-p",
      "content": "\n<p><strong>Office 365</strong> is an integrated experience of apps and services, designed to help you pursue your passion and grow your business. Get apps like Word, Excel, PowerPoint, and more, updated monthly with the latest features and security updates. Use cloud-powered email to reach customers and coworkers wherever work takes you.</p>\n",
      "excerpt": "<p>Office 365 is an integrated experience of apps and services, designed to help you pursue your passion and grow your business. Get apps like Word, Excel, PowerPoint, and more, updated monthly with the latest features and security updates. Use cloud-powered email to reach customers and coworkers wherever work takes you.</p>\n",
      "slug": "sharepoint-office-365",
      "guid": "http://sharepoint.photo.blog/?p=25",
      "status": "publish",
      "sticky": false,
      "password": "",
      "parent": false,
      "type": "post",
      "discussion": {
        "comments_open": true,
        "comment_status": "open",
        "pings_open": true,
        "ping_status": "open",
        "comment_count": 0
      },
      "likes_enabled": true,
      "sharing_enabled": true,
      "like_count": 0,
      "i_like": false,
      "is_reblogged": false,
      "is_following": true,
      "global_ID": "54c1e0efcb11d63224a737c0e494610f",
      "featured_image": "",
      "post_thumbnail": null,
      "format": "standard",
      "geo": false,
      "menu_order": 0,
      "page_template": "",
      "publicize_URLs": [],
      "terms": {
        "category": {
          "Uncategorized": {
            "ID": 1,
            "name": "Uncategorized",
            "slug": "uncategorized",
            "description": "",
            "post_count": 4,
            "parent": 0,
            "meta": {
              "links": {
                "self": "https://public-api.wordpress.com/rest/v1.1/sites/171250488/categories/slug:uncategorized",
                "help": "https://public-api.wordpress.com/rest/v1.1/sites/171250488/categories/slug:uncategorized/help",
                "site": "https://public-api.wordpress.com/rest/v1.1/sites/171250488"
              }
            }
          }
        },
        "post_tag": {},
        "post_format": {},
        "mentions": {}
      },
      "tags": {},
      "categories": {
        "Uncategorized": {
          "ID": 1,
          "name": "Uncategorized",
          "slug": "uncategorized",
          "description": "",
          "post_count": 4,
          "parent": 0,
          "meta": {
            "links": {
              "self": "https://public-api.wordpress.com/rest/v1.1/sites/171250488/categories/slug:uncategorized",
              "help": "https://public-api.wordpress.com/rest/v1.1/sites/171250488/categories/slug:uncategorized/help",
              "site": "https://public-api.wordpress.com/rest/v1.1/sites/171250488"
            }
          }
        }
      },
      "attachments": {},
      "attachment_count": 0,
      "metadata": [
        {
          "id": "79",
          "key": "jabber_published",
          "value": "1578479934"
        },
        {
          "id": "84",
          "key": "timeline_notification",
          "value": "1578479936"
        }
      ],
      "meta": {
        "links": {
          "self": "https://public-api.wordpress.com/rest/v1.1/sites/171250488/posts/25",
          "help": "https://public-api.wordpress.com/rest/v1.1/sites/171250488/posts/25/help",
          "site": "https://public-api.wordpress.com/rest/v1.1/sites/171250488",
          "replies": "https://public-api.wordpress.com/rest/v1.1/sites/171250488/posts/25/replies/",
          "likes": "https://public-api.wordpress.com/rest/v1.1/sites/171250488/posts/25/likes/"
        }
      },
      "capabilities": {
        "publish_post": true,
        "delete_post": true,
        "edit_post": true
      },
      "other_URLs": {}}
    this was my output from WordPress - "When post is created" connector.

    Am I doing something wrong? Is there an way to get particular WordPress post image URL via MS flow?

    Thank you,
    Wednesday, January 22, 2020 12:26 PM

Answers

  • Thanks for your replay Jerry. I have found my answer.

    In my output there is a one field called "Content". Over there i have receive whole page as HTML form so i have find "src=" key in body of "Content" and split that image URL from "content". 

    Ref-

    <p>As we celebrate the birthday of Dr. Martin Luther King, Jr., we reflect on the countless lessons bestowed upon us that live on with his legacy. As the great civil rights leader who stressed the importance of unity, peace, education, and more, Martin Luther King provided valuable lessons that can be applied to many aspects of life. Beyond living by these inspiring words ourselves, sharing these lessons with young children holds the most power of all, because creating a real difference in the world starts with our children.&nbsp;</p>
    
    <h2><strong>“HATE CANNOT DRIVE OUT HATE. ONLY LOVE CAN DO THAT.”</strong></h2>
    
    <p>It may feel like a natural instinct to fight fire with fire, even if we know the result will only make things worse. When we fight back, we not only make enemies, but in turn make it harder to find solutions to the real issue at hand. By discussing Dr. King’s efforts with children, we can show them there’s another way. </p>
    
    <figure class="wp-block-image"><img src="https://malvernschool.com/wp-files/wp-content/uploads/2020/01/Martin-luther-king-jr-speech-feat.jpg" alt="" /></figure>
    
    <p></p>
    
    <h2>&nbsp;<strong>“THE TIME IS ALWAYS RIGHT TO DO THE RIGHT THING.”</strong></h2>
    
    <p>Decades after being uttered, these words are perhaps more important than ever. Today we must empower our children by teaching them to stand up for what’s right, speak for those who can’t speak up for themselves, and always do the right thing … no matter how hard it may be.</p>
    
    <h2><strong>&nbsp;“LIFE’S MOST PERSISTENT AND URGENT QUESTION IS: WHAT ARE YOU DOING FOR OTHERS?”</strong></h2>
    
    <p>Even more than speaking out when we see a problem or injustice, our children should know there is always something they can do to make the world a better place. Whether it’s helping a friend or sharing a smile, each act of kindness makes the world a better place.</p>
    
    <h2>&nbsp;<strong>“IF I CANNOT DO GREAT THINGS, I CAN DO SMALL THINGS IN A GREAT WAY.”</strong></h2>
    
    <p>Finally, we must teach our children to put their hearts into all they do – even the small things. Learning to lead their lives in such a way will contribute to countless great things over the course of a lifetime.</p>
    
    <p>Categories:&nbsp;<a href="https://malvernschool.com/blog/categories/general/">General</a>,&nbsp;<a href="https://malvernschool.com/blog/categories/parenting/">Parenting</a></p>
    
    <p>Posted On: January 20, 2020</p>
    
    <p><a href="https://malvernschool.com/blog/">View All Blog Posts</a></p>

    On above output, i have find the "src=" key and split the image URL.

    Full Output is:

    {  "ID": 25,
      "site_ID": ,
      "author": {
        "ID": , "login": "", "email": ,"name": "", "first_name": "", "last_name": "", "nice_name": "ab",
        "URL": "", "avatar_URL": "",
        "profile_URL": "",  "site_ID": 
      },
      "date": "2020-01-08T10:38:53+00:00",
      "modified": "2020-01-08T10:38:53+00:00",
      "title": "SharePoint Office 365",
      "URL": "http://sharepoint.photo.blog/2020/01/08/sharepoint-office-365/",
      "short_URL": "https://wp.me/pbAy4E-p",
      "content": "\n<p>As we celebrate the birthday of Dr. Martin Luther King, Jr., we reflect on the countless lessons bestowed upon us that live on with his legacy. As the great civil rights leader who stressed the importance of unity, peace, education, and more, Martin Luther King provided valuable lessons that can be applied to many aspects of life. Beyond living by these inspiring words ourselves, sharing these lessons with young children holds the most power of all, because creating a real difference in the world starts with our children.&nbsp;</p><h2><strong>“HATE CANNOT DRIVE OUT HATE. ONLY LOVE CAN DO THAT.”</strong></h2><p>It may feel like a natural instinct to fight fire with fire, even if we know the result will only make things worse. When we fight back, we not only make enemies, but in turn make it harder to find solutions to the real issue at hand. By discussing Dr. King’s efforts with children, we can show them there’s another way. </p><figure class="wp-block-image"><img src="https://malvernschool.com/wp-files/wp-content/uploads/2020/01/Martin-luther-king-jr-speech-feat.jpg" alt="" /></figure><p></p><h2>&nbsp;<strong>“THE TIME IS ALWAYS RIGHT TO DO THE RIGHT THING.”</strong></h2><p>Decades after being uttered, these words are perhaps more important than ever. Today we must empower our children by teaching them to stand up for what’s right, speak for those who can’t speak up for themselves, and always do the right thing … no matter how hard it may be.</p><h2><strong>&nbsp;“LIFE’S MOST PERSISTENT AND URGENT QUESTION IS: WHAT ARE YOU DOING FOR OTHERS?”</strong></h2><p>Even more than speaking out when we see a problem or injustice, our children should know there is always something they can do to make the world a better place. Whether it’s helping a friend or sharing a smile, each act of kindness makes the world a better place.</p><h2>&nbsp;<strong>“IF I CANNOT DO GREAT THINGS, I CAN DO SMALL THINGS IN A GREAT WAY.”</strong></h2><p>Finally, we must teach our children to put their hearts into all they do – even the small things. Learning to lead their lives in such a way will contribute to countless great things over the course of a lifetime.</p><p>Categories:&nbsp;<a href="https://malvernschool.com/blog/categories/general/">General</a>,&nbsp;<a href="https://malvernschool.com/blog/categories/parenting/">Parenting</a></p><p>Posted On: January 20, 2020</p><p><a href="https://malvernschool.com/blog/">View All Blog Posts</a></p>\n",
      "excerpt": "<p>As we celebrate the birthday of Dr. Martin Luther King, Jr., we reflect on the countless lessons bestowed upon us that live on with his legacy. As the great civil rights leader who stressed the importance of unity, peace, education, and more, Martin Luther King provided valuable lessons that can be applied to many aspects [&hellip;]</p>\n",
      "slug": "sharepoint-office-365",
      "guid": "http://sharepoint.photo.blog/?p=25",
      "status": "publish",
      "sticky": false,
      "password": "",
      "parent": false,
      "type": "post",
      "discussion": {
        "comments_open": true,
        "comment_status": "open",
        "pings_open": true,
        "ping_status": "open",
        "comment_count": 0
      },
      "likes_enabled": true,
      "sharing_enabled": true,
      "like_count": 0,
      "i_like": false,
      "is_reblogged": false,
      "is_following": true,
      "global_ID": "54c1e0efcb11d63224a737c0e494610f",
      "featured_image": "",
      "post_thumbnail": null,
      "format": "standard",
      "geo": false,
      "menu_order": 0,
      "page_template": "",
      "publicize_URLs": [],
      "terms": {
        "category": {
          "Uncategorized": {
            "ID": 1,
            "name": "Uncategorized",
            "slug": "uncategorized",
            "description": "",
            "post_count": 4,
            "parent": 0,
            "meta": {
              "links": {
                "self": "https://public-api.wordpress.com/rest/v1.1/sites/171250488/categories/slug:uncategorized",
                "help": "https://public-api.wordpress.com/rest/v1.1/sites/171250488/categories/slug:uncategorized/help",
                "site": "https://public-api.wordpress.com/rest/v1.1/sites/171250488"
              }
            }
          }
        },
        "post_tag": {},
        "post_format": {},
        "mentions": {}
      },
      "tags": {},
      "categories": {
        "Uncategorized": {
          "ID": 1,
          "name": "Uncategorized",
          "slug": "uncategorized",
          "description": "",
          "post_count": 4,
          "parent": 0,
          "meta": {
            "links": {
              "self": "https://public-api.wordpress.com/rest/v1.1/sites/171250488/categories/slug:uncategorized",
              "help": "https://public-api.wordpress.com/rest/v1.1/sites/171250488/categories/slug:uncategorized/help",
              "site": "https://public-api.wordpress.com/rest/v1.1/sites/171250488"
            }
          }
        }
      },
      "attachments": {},
      "attachment_count": 0,
      "metadata": [
        {
          "id": "79",
          "key": "jabber_published",
          "value": "1578479934"
        },
        {
          "id": "84",
          "key": "timeline_notification",
          "value": "1578479936"
        }
      ],
      "meta": {
        "links": {
          "self": "https://public-api.wordpress.com/rest/v1.1/sites/171250488/posts/25",
          "help": "https://public-api.wordpress.com/rest/v1.1/sites/171250488/posts/25/help",
          "site": "https://public-api.wordpress.com/rest/v1.1/sites/171250488",
          "replies": "https://public-api.wordpress.com/rest/v1.1/sites/171250488/posts/25/replies/",
          "likes": "https://public-api.wordpress.com/rest/v1.1/sites/171250488/posts/25/likes/"
        }
      },
      "capabilities": {
        "publish_post": true,
        "delete_post": true,
        "edit_post": true
      },
      "other_URLs": {}}

    For split the string please ref-

    Split

    Substring

    Thanks,

    Bavya.R



    Thursday, January 23, 2020 11:13 AM

All replies

  • Hi, Bavya,

    This forum focus on issues concerning SharePoint products. According to your screenshot and description, you issue seems to be the WordPress connector. The flow runs properly and your question is about not finding dynamic content holds the image URL in the Post. 

    As i am not an expert on Flow, it may be better for you to post your concerns on Flow(Power Automate) forum. Technicians there will provide more information about the possibility to fetch post image URL from WordPress.

    Best Regards

    Jerry


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Thursday, January 23, 2020 8:46 AM
  • Thanks for your replay Jerry. I have found my answer.

    In my output there is a one field called "Content". Over there i have receive whole page as HTML form so i have find "src=" key in body of "Content" and split that image URL from "content". 

    Ref-

    <p>As we celebrate the birthday of Dr. Martin Luther King, Jr., we reflect on the countless lessons bestowed upon us that live on with his legacy. As the great civil rights leader who stressed the importance of unity, peace, education, and more, Martin Luther King provided valuable lessons that can be applied to many aspects of life. Beyond living by these inspiring words ourselves, sharing these lessons with young children holds the most power of all, because creating a real difference in the world starts with our children.&nbsp;</p>
    
    <h2><strong>“HATE CANNOT DRIVE OUT HATE. ONLY LOVE CAN DO THAT.”</strong></h2>
    
    <p>It may feel like a natural instinct to fight fire with fire, even if we know the result will only make things worse. When we fight back, we not only make enemies, but in turn make it harder to find solutions to the real issue at hand. By discussing Dr. King’s efforts with children, we can show them there’s another way. </p>
    
    <figure class="wp-block-image"><img src="https://malvernschool.com/wp-files/wp-content/uploads/2020/01/Martin-luther-king-jr-speech-feat.jpg" alt="" /></figure>
    
    <p></p>
    
    <h2>&nbsp;<strong>“THE TIME IS ALWAYS RIGHT TO DO THE RIGHT THING.”</strong></h2>
    
    <p>Decades after being uttered, these words are perhaps more important than ever. Today we must empower our children by teaching them to stand up for what’s right, speak for those who can’t speak up for themselves, and always do the right thing … no matter how hard it may be.</p>
    
    <h2><strong>&nbsp;“LIFE’S MOST PERSISTENT AND URGENT QUESTION IS: WHAT ARE YOU DOING FOR OTHERS?”</strong></h2>
    
    <p>Even more than speaking out when we see a problem or injustice, our children should know there is always something they can do to make the world a better place. Whether it’s helping a friend or sharing a smile, each act of kindness makes the world a better place.</p>
    
    <h2>&nbsp;<strong>“IF I CANNOT DO GREAT THINGS, I CAN DO SMALL THINGS IN A GREAT WAY.”</strong></h2>
    
    <p>Finally, we must teach our children to put their hearts into all they do – even the small things. Learning to lead their lives in such a way will contribute to countless great things over the course of a lifetime.</p>
    
    <p>Categories:&nbsp;<a href="https://malvernschool.com/blog/categories/general/">General</a>,&nbsp;<a href="https://malvernschool.com/blog/categories/parenting/">Parenting</a></p>
    
    <p>Posted On: January 20, 2020</p>
    
    <p><a href="https://malvernschool.com/blog/">View All Blog Posts</a></p>

    On above output, i have find the "src=" key and split the image URL.

    Full Output is:

    {  "ID": 25,
      "site_ID": ,
      "author": {
        "ID": , "login": "", "email": ,"name": "", "first_name": "", "last_name": "", "nice_name": "ab",
        "URL": "", "avatar_URL": "",
        "profile_URL": "",  "site_ID": 
      },
      "date": "2020-01-08T10:38:53+00:00",
      "modified": "2020-01-08T10:38:53+00:00",
      "title": "SharePoint Office 365",
      "URL": "http://sharepoint.photo.blog/2020/01/08/sharepoint-office-365/",
      "short_URL": "https://wp.me/pbAy4E-p",
      "content": "\n<p>As we celebrate the birthday of Dr. Martin Luther King, Jr., we reflect on the countless lessons bestowed upon us that live on with his legacy. As the great civil rights leader who stressed the importance of unity, peace, education, and more, Martin Luther King provided valuable lessons that can be applied to many aspects of life. Beyond living by these inspiring words ourselves, sharing these lessons with young children holds the most power of all, because creating a real difference in the world starts with our children.&nbsp;</p><h2><strong>“HATE CANNOT DRIVE OUT HATE. ONLY LOVE CAN DO THAT.”</strong></h2><p>It may feel like a natural instinct to fight fire with fire, even if we know the result will only make things worse. When we fight back, we not only make enemies, but in turn make it harder to find solutions to the real issue at hand. By discussing Dr. King’s efforts with children, we can show them there’s another way. </p><figure class="wp-block-image"><img src="https://malvernschool.com/wp-files/wp-content/uploads/2020/01/Martin-luther-king-jr-speech-feat.jpg" alt="" /></figure><p></p><h2>&nbsp;<strong>“THE TIME IS ALWAYS RIGHT TO DO THE RIGHT THING.”</strong></h2><p>Decades after being uttered, these words are perhaps more important than ever. Today we must empower our children by teaching them to stand up for what’s right, speak for those who can’t speak up for themselves, and always do the right thing … no matter how hard it may be.</p><h2><strong>&nbsp;“LIFE’S MOST PERSISTENT AND URGENT QUESTION IS: WHAT ARE YOU DOING FOR OTHERS?”</strong></h2><p>Even more than speaking out when we see a problem or injustice, our children should know there is always something they can do to make the world a better place. Whether it’s helping a friend or sharing a smile, each act of kindness makes the world a better place.</p><h2>&nbsp;<strong>“IF I CANNOT DO GREAT THINGS, I CAN DO SMALL THINGS IN A GREAT WAY.”</strong></h2><p>Finally, we must teach our children to put their hearts into all they do – even the small things. Learning to lead their lives in such a way will contribute to countless great things over the course of a lifetime.</p><p>Categories:&nbsp;<a href="https://malvernschool.com/blog/categories/general/">General</a>,&nbsp;<a href="https://malvernschool.com/blog/categories/parenting/">Parenting</a></p><p>Posted On: January 20, 2020</p><p><a href="https://malvernschool.com/blog/">View All Blog Posts</a></p>\n",
      "excerpt": "<p>As we celebrate the birthday of Dr. Martin Luther King, Jr., we reflect on the countless lessons bestowed upon us that live on with his legacy. As the great civil rights leader who stressed the importance of unity, peace, education, and more, Martin Luther King provided valuable lessons that can be applied to many aspects [&hellip;]</p>\n",
      "slug": "sharepoint-office-365",
      "guid": "http://sharepoint.photo.blog/?p=25",
      "status": "publish",
      "sticky": false,
      "password": "",
      "parent": false,
      "type": "post",
      "discussion": {
        "comments_open": true,
        "comment_status": "open",
        "pings_open": true,
        "ping_status": "open",
        "comment_count": 0
      },
      "likes_enabled": true,
      "sharing_enabled": true,
      "like_count": 0,
      "i_like": false,
      "is_reblogged": false,
      "is_following": true,
      "global_ID": "54c1e0efcb11d63224a737c0e494610f",
      "featured_image": "",
      "post_thumbnail": null,
      "format": "standard",
      "geo": false,
      "menu_order": 0,
      "page_template": "",
      "publicize_URLs": [],
      "terms": {
        "category": {
          "Uncategorized": {
            "ID": 1,
            "name": "Uncategorized",
            "slug": "uncategorized",
            "description": "",
            "post_count": 4,
            "parent": 0,
            "meta": {
              "links": {
                "self": "https://public-api.wordpress.com/rest/v1.1/sites/171250488/categories/slug:uncategorized",
                "help": "https://public-api.wordpress.com/rest/v1.1/sites/171250488/categories/slug:uncategorized/help",
                "site": "https://public-api.wordpress.com/rest/v1.1/sites/171250488"
              }
            }
          }
        },
        "post_tag": {},
        "post_format": {},
        "mentions": {}
      },
      "tags": {},
      "categories": {
        "Uncategorized": {
          "ID": 1,
          "name": "Uncategorized",
          "slug": "uncategorized",
          "description": "",
          "post_count": 4,
          "parent": 0,
          "meta": {
            "links": {
              "self": "https://public-api.wordpress.com/rest/v1.1/sites/171250488/categories/slug:uncategorized",
              "help": "https://public-api.wordpress.com/rest/v1.1/sites/171250488/categories/slug:uncategorized/help",
              "site": "https://public-api.wordpress.com/rest/v1.1/sites/171250488"
            }
          }
        }
      },
      "attachments": {},
      "attachment_count": 0,
      "metadata": [
        {
          "id": "79",
          "key": "jabber_published",
          "value": "1578479934"
        },
        {
          "id": "84",
          "key": "timeline_notification",
          "value": "1578479936"
        }
      ],
      "meta": {
        "links": {
          "self": "https://public-api.wordpress.com/rest/v1.1/sites/171250488/posts/25",
          "help": "https://public-api.wordpress.com/rest/v1.1/sites/171250488/posts/25/help",
          "site": "https://public-api.wordpress.com/rest/v1.1/sites/171250488",
          "replies": "https://public-api.wordpress.com/rest/v1.1/sites/171250488/posts/25/replies/",
          "likes": "https://public-api.wordpress.com/rest/v1.1/sites/171250488/posts/25/likes/"
        }
      },
      "capabilities": {
        "publish_post": true,
        "delete_post": true,
        "edit_post": true
      },
      "other_URLs": {}}

    For split the string please ref-

    Split

    Substring

    Thanks,

    Bavya.R



    Thursday, January 23, 2020 11:13 AM
  • Hi, Bavya,

    If possible, please sharing your findings here and mark it as answer. It will help other community members with similar question.

    Best Regards

    Jerry


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Friday, January 24, 2020 1:01 AM