Type Into- HTML

code
activities
studio
enterprise
string

#1

Hey,
I’m trying to type a very large block of html into Jobvite using a Type Into activity as a string, or have UiPath convert it like in the Outlook activity. I get an error when I surround the html with quotes or try to paste it as is.

Does anyone know how to type html using UiPath?

Thanks


#2

Whats the error?


#3

@CBlanchard its
The workflow has validation errors. Review and resolve them first.
System.Activities.InvalidWorkflowException: The workflow has validation errors. Review and resolve them first. —> System.Activities.ValidationException:+++HTML Code+++
Compiler error(s) encountered processing expression
Expected ‘%=’ at start of an embedded expression

— End of inner exception stack trace —


#4

whats the html code?

do you have a copy of your workflow?


#5

@CBlanchard

Main.xaml (49.5 KB)

^^The workflow I just need to paste the html code into a text field in Jobvite whatever way that may be,
with variables that I will put inside the HTML

HTML.pdf (222.9 KB)


#6

Ok your issue here is the abundance of " " in your code which is confusing the ‘type into’ box.

Your html code is also extremely messy, I’d suggest getting whoever wrote it to put all the styling in a .css file and link to that.

Then it would be simpler to implement, otherwise you’ll have to do a lot of joining like:

“<table border=”+“0”+" cellpadding="+“0”+" cellspacing="+"+“0”+" Class="+“bodyblack”+" style="+“font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px;”+" width="+“450”+">"

See how i had to put + to join the strings?

Even doing internal css would be better like:



table {border:0;cellpadding:0;cellspacing:0;}

<body>
Hello this is my table

</body>
</html>

EDIT:

You could save the html in a .txt file and just load the details straight into the type into box from the .txt file. Save the .txt file contents as a variable and there you go.

htmlcode.zip (218.3 KB)


#8

@CBlanchard

Makes sense, I definitely don’t want to have to do all that joining. The workflow will be in a for-each loop that is picking up values from an iterating excel table, so obviously somehow UiPath needs access to the variables (like it would in a type-to activity) so the variables can change each iteration.

-I’m not sure how to convert the html’s css into internal css, but if it removes the “” then I would be all for it. That seems like the most pragmatic option right?
-I don’t know how to put html into a .css file nor how to paste it into a text box
-Would I be able to easily edit the variables in a .txt format every iteration? Maybe there I could use a .Replace method for those variables each loop, not sure how that would like however.

You have really good information! :slight_smile:


#9

.replace would work fine.

You could cheat it and break up your html code into different .txt files when you reach a variable, then do something like:

type into:
txtfile1 + variable 1 + txtfile2 + variable 2

Or if you want to go the html route with internal or external CSS you’ll still have to break up your html by variable:

type into:
"<p>hiring manager is"+managername+"</p>"

Personally, i’d go the .txt file route as its probably going to be faster to edit in future, and easier to understand.

Edit:
For information on internal and external css see here: https://study.com/academy/lesson/cascading-style-sheets-css-definition-types-examples.html


#10

@CBlanchard

Awesome. I like the text file idea. Since I don’t know HTML or CSS is there a way to automatically convert it to CSS if that makes any sense haha? How many quotes would that remove?

Thanks


#11

Yeah, use https://wordtohtml.net/ and play around with this.