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 / Targeting a field in a...
Power Automate
Answered

Targeting a field in a web page built upon Salesforce.

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

When in Record mode I try to target (and open) a field in a web page built upon Salesforce what PAD sees is the frame around the frame within which the field is located.

 

What I'd like to do is 1) select the pencil next to the field to edit it then 2) click in that field and select from the dropdown box that appears.

 

I'd use View Source to identify the names of 1) pencil and 2) dropdown list and then manipulate those directly from a scripting language.  I see that PAD has, for example, a python script object but have yet to use it.  When calling the python script I'd like to pass it the object corresponding to the currently targeted web page.  Etc.

I have the same question (0)
  • momlo Profile Picture
    1,527 Super User 2024 Season 1 on at

    Hi @Anonymous 

    Yeah, if it recognizes the parent element but not child elements, you are forced to use other methods.

    I would see if you can navigate the page/execute your flow with JS script, if yes - then use run JS script in pad.

     

    Also, have you seen that you can use Power Autoamte (cloud) flow and use API via Salesforce connector, maybe there is no need to automate via Desktop at all?

    https://powerautomate.microsoft.com/en-us/connectors/details/shared_salesforce/salesforce/

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks - those are both good suggestions.

     

    I'm not sure I've directly programmatically interacted with a web page via javascript.  I mean, I've had plenty of experience working with javascript as part of programming on websites but I'm not sure I've done exactly what you suggest - so obviously I'm a little unclear on this.  I'll look around in PAD help and will google but if you could provide a pointer that would also be helpful.

     

    And yes, I've been meaning to look at (more closely) just what a PA cloud flow would give me.  And will do so.

  • Verified answer
    momlo Profile Picture
    1,527 Super User 2024 Season 1 on at

    Man... then you are at home with JS, haha. 

    Take a look here to get an idea. Basically, you can run any JS code in the browser and get your data/click/automate using JS instead of other PAD actions.  Whatever JS you would write on page to get things done, you can use in PAD:

    https://learn.microsoft.com/en-us/power-automate/desktop-flows/how-to/populate-text-fields-click-links-javascript

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Oops didn't mean to mark that as the solution - this is ongoing.

     

    Googled (and used ChatGPT) and have been trying out various expressions to get the object that I want.  The first didn't work but this expression does (sort of):

     

    let test1 = document.getElementsByClassName("slds-button")

     

    except that it returns an array of 58 items and I have to figure out how to find the one I want.  slds = Salesforce Lightning Design System.

     

    In its raw form the object looks like this:

     

    <button class="slds-button slds-button_icon slds-button_icon-bare" title="Edit" type="button" value="Status"><lightning-primitive-icon><svg class="slds-button__icon" focusable="false" data-key="edit" aria-hidden="true" viewBox="0 0 52 52"><g><g><path d="M9.5 33.4l8.9 8.9c.4.4 1 .4 1.4 0L42 20c.4-.4.4-1 0-1.4l-8.8-8.8c-.4-.4-1-.4-1.4 0L9.5 32.1c-.4.4-.4 1 0 1.3zM36.1 5.7c-.4.4-.4 1 0 1.4l8.8 8.8c.4.4 1 .4 1.4 0l2.5-2.5c1.6-1.5 1.6-3.9 0-5.5l-4.7-4.7c-1.6-1.6-4.1-1.6-5.7 0l-2.3 2.5zM2.1 48.2c-.2 1 .7 1.9 1.7 1.7l10.9-2.6c.4-.1.7-.3.9-.5l.2-.2c.2-.2.3-.9-.1-1.3l-9-9c-.4-.4-1.1-.3-1.3-.1l-.2.2c-.3.3-.4.6-.5.9L2.1 48.2z"></path></g></g></svg></lightning-primitive-icon><span class="slds-assistive-text">Edit</span></button>

     

    Clearly, I'm sort of fumbling around here but then I haven't done this sort of stuff in quite a long time.  Apologies.

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 632

#2
Haque Profile Picture

Haque 458

#3
Valantis Profile Picture

Valantis 357

Last 30 days Overall leaderboard