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 / Web Data Extraction //...
Power Automate
Answered

Web Data Extraction // Data Type Conversion of extracted data to String

(0) ShareShare
ReportReport
Posted on by 9
Hi there,
 
i'm fairly new to Power Automate Desktop and even though i was able to successfully build the flow i needed there is something i couldn't accomplish - and i'm convinced there has to be a simple solution that i'm just not aware of.
 
I'm using the Web Data Extract feature to read a list of HREF attributes of a link list on a web page.
Within a foreach loop i tried to apply string manipulations on the current item (which i expected to be a string) but always get a data type error (text functions not possible on ExternalObjects).
Same applies when i do extract a single web element's innerHTML to a variable.
 
Not a biggie, would typically just convert the variable to text and then manipulate it.
But i can't seem to find a way to convert a web extracted value to a string.
 
What i did to get my flow working was to write the extracted value/variable to an excel cell, read it again as single value from said cell, then it's data type became string and i was able to manipulate it before using further.
 
I'm quite sure there has to be a way more elegant method to perform the needed data type conversion :)
Does anyone have a solution for my problem? I've been searching the web for ages but could not manage to find one...
 
Thx a lot!
Categories:
I have the same question (0)
  • Suggested answer
    Eddy Wu Profile Picture
    27 on at

    Hi,

    I suggest using the "Get Details of Element on Web Page" function to retrieve the innerHTML or HREF directly from the element.

    Additionally, if you still need to convert the variable, you can use the "Convert Custom Object to JSON" function to extract and adjust the required attributes.

    If this resolves your question, please mark it as answered and consider giving it a Like.

    Best regards,
    Eddy

  • Verified answer
    OS-24101204-0 Profile Picture
    9 on at
    Hi Eddy,
     
    thank you for responding to my question - unfortunately that didn't solve my Problem or provide a solution.
    Stubborn as i am i couldn't leave the topic alone and i finally found the explanation/solution on my own:
     
    First: PAD Workflows differ concerning variable notation, depending if Power FX is activated or not.
     
    The Web Data Extract connector always creates a data table object, even if only a single value is extracted (as for example an innerHTML of a div element). Even when a list of entries is extracted - like the link list in my original post - the generated object is always a data table, not a data list object.
     
    To directly access the values it's necessary to double index the query as in 2-dimensional arrays.
    Given the extracted data was saved in the default variable DataFromWebPage and no foreach loop is used:
     
    Without Power FX
    %DataFromWebPage[0][0]%
     
    With Power FX
    =Index(Index(DataFromWebPage, 1), 1)
     
    Accordingly when using a foreach loop on the DataFromWebPage object (which of course creates a data list object, default name is CurrentItem):
     
    Without Power FX
    %CurrentItem[0]%
     
    With Power FX:
    =Index(CurrentItem, 1)
     
    Hopefully this will help other new Power Automate'rs saving valuable time on this topic.
     
    TGF, have a nice weekend & Best Regards
    Oliver
  • Clifferton Profile Picture
    94 on at
    Holy Cow! Thank you so much! I searched in so many different ways to try to find this information.  We can't be the only people having this issue, right? Do other people just give up sooner?

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 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard