RVK
(Rvk)
September 29, 2022, 4:58am
1
Hi,
the below code is a html text stored in a string variable, and promote is another string variable.
"<center><p style='background-color:rgb(0, 204, 255);color:White;position:relative;top:-10px;border: 5px solid white;border-color: #96D4D4;border-style:outset;'>cmi"+promote+"<br></p></center>"
How to pass this html text into Uipath form html content.
collections
Please suggest the required modifications
Thankyou
Hello @RVK Welcome to UiPath Community
Kindly refer to this thread, you may get some idea
How can I pass a variable to the HTML Element component in UiPath Form Designer.
If there is no way to pass a single variable, is there a way to pass entire html file?
The UiPath Documentation Portal - the home of all our valuable information. Find here everything you need to guide you in your automation journey in the UiPath ecosystem, from complex installation guides to quick tutorials, to practical business...
1 Like
RVK
(Rvk)
September 29, 2022, 6:19am
3
Thanks for the reply i read this post and followed the same method not able to get the result
Hello.
You can also use the Custom Input activity to display a HTML form.
Here I shall introduce this activity, that it seems to be useful to me.
It could be find in the group UIPath.Core.Activities.CustomInput.
This requires the path to the HTML file defining your HTML form.
The output argument can be a new result string variable.
Please see the next picture:
Using this method may need few knowlege of HTML and / or scripting.
And of course, the appearance of the form could be still improved.
I had created a Form.html WEB page with the following content:
Form.html (1.4 KB)
<!-- saved from url=(0016)http://localhost -->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Choose Your Message</title>
</head>
<body>
<form>
<label>Promote: </label>
<input type="text" id="ID_TEXT1" autofocus="true">
<br>
<div id="ID_DIV1">
<center>
<p style='background-color:rgb(0, 204, 255);color:White;position:relative;top:-10px;border: 5px solid white;border-color: #96D4D4;border-style:outset;'>
cmi"+promote+"
<br></p>
</center>
</div>
<input type="submit" id="ID_OK" value="Validate" onclick="validate()">
</form>
<script type="text/javascript">
function init_controls(){
// Init your controls here
document.getElementById("ID_TEXT1").onkeyup = function(event){
var promo = event.target.value.toString();
var text = document.getElementById("ID_DIV1");
text.innerHTML = "<center>" +
"<p style='background-color:rgb(0, 204, 255);color:White;position:relative;top:-10px;border: 5px solid white;border-color: #96D4D4;border-style:outset;'>" +
"cmi " + promo + "<br></p></center>";
};
}
function validate(){
var ctrl1 = document.getElementById("ID_TEXT1");
var message = ctrl1.value;
window.external.setResult(message);
document.close();
}
init_controls();
</script>
</body>
</html>
Hope it helps. Best regards, Adrian
Hello, maybe you should also create an output argument, if you use the Form Designer.
Adrian