Sample Code from Matthew Senay

Created by Matthew Senay:  Just finished up with some JS that’ll disable a button. I’ve included it as a text document.

Simply add a button, rename it, and copy/paste the Javascript into a Click > Execute Javascript action in Flow.

Update the button name variable in the script with the name of your button and you should be good to go.

You can add all the actions you want after that. Might need some more testing if you want it super accurate, but it’s a start.

IMPORTANT NOTE: You must be a Business Plus or Enterprise Customer to access the ExectureJS Feature. 

dominKnow does not endorse or support customer supplied examples. They are intended for you to learn from and use at your own discretion. 

//Update this with the name of button
let buttonName = "FILL THIS IN";

//Get button
let myEl = document.querySelector('[data-title="' + buttonName + '"]');

//Create cover for button
var newElement = document.createElement("div");

//Set class for button cover to help find if needed
newElement.setAttribute("class", "buttonCover");

//Get computed CSS of the button element
let compEl = window.getComputedStyle(myEl);

//Apply styles to cover button = compEl.getPropertyValue("height"); = compEl.getPropertyValue("width"); = "absolute"; = "rgba(255,255,255,0.5)"; = "1000";

//Insert new element
myEl.parentNode.insertBefore(newElement, myEl);
  0     0

Similar Projects

Questions  ( 0 )