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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to replace undefin...
Power Automate
Answered

How to replace undefined variables.

(0) ShareShare
ReportReport
Posted on by

Hi,

 

When extracting data from a web page, items A and B in the figure below can be extracted, but item C is <td></td> in the html, and when the data is extracted, it becomes an undefined item, and the data is neither blank nor null. Is there a way to assign a specific character (False) to an undefined item in Power Automate Desktop?

Torusan_0-1719279716091.png

 

Kind Regards,
Toru 

I have the same question (0)
  • Deenuji_Loganathan_ Profile Picture
    6,250 Moderator on at

    @Toru-san 

     

    You can use JavaScript to check if your C items have any value or are null, and then assign that value to a variable.

    If you're unsure how to proceed, please share the HTML code of your C item, and I will help you accomplish this.

     


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀

  • Toru-san Profile Picture
    on at

    Hi Deenuji-san,

     

    Thank you for your reply.

    I cannot send it because there is company information in the html source.
    Below is the information I would like to discuss first.

     

    When I extract data from a web page using JavaScript (variable: DataFromWebPage),
    an error occurs in the following part. In other words, the results extracted in <td></td> are neither blank nor null.
    Is there a way to check this using JavaScript, or can I take another action to deal with it?

     

    --
    var variable1 = '%DataFromWebPage%';
    --

     

    Kind Regards,
    Toru

  • Deenuji_Loganathan_ Profile Picture
    6,250 Moderator on at

    @Toru-san 

     

    How is your DataFromWebPage values looks like ? Share some screenshot after hiding all senstive info?

    Just want to see where the C items value present in your datatable.

     

    But this is the syntax to read the value from datatable: 

     

    var variable1 = '%DataFromWebPage[0][0]%';

     


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀

     

     

  • Toru-san Profile Picture
    on at

    Hi Deenuji-san,

     

    Thank you for your reply.

    We are sorry, the PAD screen in the image below is in Japanese. The variable DataFromWebPage is set to the value C.
    The image below is the html part. Does it make sense what I'm saying?

    Torusan_0-1719297484941.png

    Torusan_1-1719297499372.png

     

    Kind Regards,
    Toru

     

  • Deenuji_Loganathan_ Profile Picture
    6,250 Moderator on at

    @Toru-san 

     

    My apologies if my ask is not clear. I am asking screenshot of your data table like below screenshot?

    Deenuji_0-1719304457825.png

     

     


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀

  • Toru-san Profile Picture
    on at

    Hi Deenuji-san,

     

    Thank you for your reply.

    The first capture is an example of when there is no data, the next capture is an example of when data is present.

    Torusan_0-1719383170635.png

    Torusan_1-1719383185804.png

    --

    Kind Regards,
    Toru

  • Deenuji_Loganathan_ Profile Picture
    6,250 Moderator on at

    @Toru-san 

     

    You can assign your data table value to set variable like below:

    %DataFromWebPage[0][0]%

     


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀

  • Verified answer
    Deenuji_Loganathan_ Profile Picture
    6,250 Moderator on at

    @Toru-san 

     

    Please refer the below approach:

     

    The datatable's Name column in the first row contains no value.

     

    To assign the first row's first column value to a variable, I first check if the value is null using an if condition with the datatable variable - %datatable[0][0]%.

     

    If a value exists, then I assign it to the variable.

    Deenuji_0-1719399664573.png

     

     


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀

  • Toru-san Profile Picture
    on at

    Hi Deenuji-san,

     

    Thank you for your cooperation.

     

    I was able to get it to work properly.
    Does putting [0][0] after a variable mean that it's a way to specify the index of a list variable?
    I learned a lot from your help. Thank you.

     

    I'd like to ask again if I have the opportunity.

    --

    Kind Regards,
    Toru

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 589

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 284 Super User 2026 Season 1

Last 30 days Overall leaderboard