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 / Javascript in web - Va...
Power Automate
Unanswered

Javascript in web - Values isn't stored

(0) ShareShare
ReportReport
Posted on by 8

Hi,

I'm trying to change most of my data entry flow to Javascript, in order to make it faster, without any JS knowledge, quite smart..

I'm using this script, which does insert values into the fields on website as it's suppose to, but the values aren't stored, meaning that if I try to go to the field and tab away, the value disappears?

 

 

function ExecuteScript() {
document.querySelectorAll('input[Id="identifier"]')[0].value="12345678";
document.querySelectorAll('input[Id="data-field-33"]')[0].value="Navn";
document.querySelectorAll('input[Id="type"]')[0].value="Trade identification number";
document.querySelectorAll('input[Id="data-field-30"]')[0].value="DK - Denmark";
}

 

 

Am I missing some kind of storing function? Thanks.

I have the same question (0)
  • VJR Profile Picture
    7,635 on at

    Assuming identifier is the id of the textbox try this

    document.getElementById('identifier').value="12345678";

     

  • Dannow Profile Picture
    8 on at

    Thanks for your answer.

    Unfortunately it's the same result. It inserts the value but once entering the field and tabbing away or performing an action like save, it removes the value from the field.

    Not sure if it can be the website, that doesn't allow the action to perform, if that's even possible?

    This is a snip of the inspect function from the field

    Dannow_0-1656669617171.png

    I also tried the following code with no luck.

    function ExecuteScript() {
    var element = document.getElementById('identifier');
    element.value = '55886699';
    }
  • VJR Profile Picture
    7,635 on at

    1. hope you are using "run javascript on webpage"  and not just javascript

    2. have you tried the conventional method of capturing the Ui element of that text box and then using populate textbox action to write data into it

  • Dannow Profile Picture
    8 on at

    Yes I am using the Run Javascript on Webpage.

    I have captured the UI elements and I am able to use them with a regular "Populate text field" module, which it stores on the webpage as it should.

  • VJR Profile Picture
    7,635 on at

    So are you saying its working fine now and the thread can be closed? 🙂

  • Dannow Profile Picture
    8 on at

    I wanted to optimize the time it took, by creating a JS load. If I create a populate textfield for each ID, then it works. Except for the dropdowns, but that can come in another thread 🙂 

  • VJR Profile Picture
    7,635 on at

    Try doing a Sendkeys TAB or ENTER after running the js.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 252 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 169

#3
Haque Profile Picture

Haque 154

Last 30 days Overall leaderboard