Hello, we have built a custom workflow node called "Digital Channel", which basically is a new custom channel that the user can add content and then send it to customers and it will end up on their "My pages" via an API. We are struggling abit with the rich text input field as we need to send it with html code to the API. When we are trying to get the data from the input field we only recieve a empty string in the javascript code:
The other input fields we are able to get, and we have tried doing the rich text field as a ordinary textfield with strings, but then we are not able to save with the correct tags.
Any idea on how to get the data from the rich text field activity?
Best Regards,
Martin
Views
Replies
Total Likes
Hi @marting66652718,
What is the data type of the field where you are storing this rich text? Usually, delivery content (html or text, or even sms) is stored in the delivery schema in a CDATA type field. You should be able to forward the CDATA text to the custom connector.
Let me know if that gives you a direction to move forward.
BR,
Ishan
Views
Replies
Total Likes
Hi, currently we have it in the extension of the workflow schema as this:
We currently don't save it otherwhere then in here.
Views
Replies
Total Likes
Hi @marting66652718,
If you are going to send this text as content in a custom channel, then you should ideally be using a delivery object to save this info. You should extend the delivery form and create a custom channel where this content be set in the delivery.
Anyways, the way you are doing it - how are you trying to fetch this in your workflow? I guess you are doing it in a js code activity. Can you share that code as well? Also, when you save your workflow after entering the rich text, are you able to see that text in the workflow xml? (Right click inside the workflow -> edit xml source.)
BR,
Ishan
Views
Replies
Total Likes
Okey, maybe Ill look more into the extention of delivery form to further create this. Is there any good documentation?
We are using a js-file to get the data from the activity:
logInfo("----- Communication service: In communicationService_call")
var delivery = NLWS.nmsDelivery.load(vars.deliveryId);
if(delivery.operation_id == 0)
delivery.operation_id = instance.operation_id;
if (delivery.workflow_id == 0)
delivery.workflow_id = instance.id;
delivery.save();
logInfo("----- Communication service: Delivery saved")
if (vars.recCount == 0) {
logWarning("Det finns inga mottagare och inget meddelande kommer att skickas till kommunikationsytor.");
task.postEvent(task.transitionByName("result"));
task.setCompleted();
} else {
try {
/* TODO: is the 3 rows below needed? */
if (!NL.hasOwnProperty("XML")) {
loadLibrary("xtk:shared/xml.js");
}
//----------------------------------------------------------------------------
// Get input values from the node that was run. Convert it to the correct format for the request.
//----------------------------------------------------------------------------
function logInputValues(inputs) {
logInfo("--- contentTemplate:", inputs["contentTemplate"])
logInfo("--- headline:", inputs["headline"])
// logInfo("--- text:", inputs["text"].replace(/ {2}/g, "\n\n"))
logInfo("--- text:", inputs["text"].replace(/ {4}/g, "\\n").replace(/ {2}/g, "\\n\\n"))
logInfo("--- deliveryCode:", inputs["deliveryCode"])
logInfo("--- category:", inputs["category"])
logInfo("--- channel:", inputs["channel"])
logInfo("--- url:", inputs["url"])
logInfo("--- urlText:", inputs["urlText"])
}
We have create a input form for this, then added it to the extension of the workflow schema. Then when you run it in a workflow, it will call this javascript connector.
When I look for the text in the workflow xml this is what I see:
<communicationService collision="0" headline="Hello Word" img="lf:communication_service_48x48.png"
label="Bolagsstämma Liten" library="lf:communicationService.js"
link="test" linkText="testst" mask="0" name="communicationService"
onError="0" textfield="<!DOCTYPE html> <html> <head> </head> <body> <p>Hello asd a sd asd</p> <p></p> <p>fasdasd</p> </body> </html>"
timezone="_inherit_" x="175" y="112">
Views
Replies
Total Likes
When I change it to CDATA type instead, I get this message when trying to save the content in the input field.
Hi again,
I try creating it as an element instead of an attribute and the error doesn't appear. But when I do that the input field doesnt show instead.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies