- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on ‎01-31-2019 09:14 PM
This is just a quick article which I hope people will find useful.
I was using Flow Designer to populate a task record's Description field using the "Create Task Record" action that comes with the Flow Designer Service Catalog plugin.
I needed to insert line-breaks into the Description field so that I could separate fields from the Catalog Variables - for example:
Do something with this Widget.
Name of submitter: <variables.submitter>
Name of widget: <variables.widgetname>
After getting some helpful suggestions online (hi SNdevs!) I found a solution for adding line breaks was to encapsulate the entire string (including data pills) in a Javascript string using \n line breaks.
For example, the syntax for the above description would be:
javascript: "Do something with this Widget. \n Name of Submitter: {{submitter data pill}} \n Name of Widget: {{widgetname data pill}}"
I hope someone else finds this useful!
- 13,343 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Thanks a lot for sharing, this will be really useful to me for Automated tests (ATF). I didn't have a good way to validate multi-line fields and was forced to make multiple contains condition for every line which is not the same as testing for the exact string.
Edit: After further usage, ATF validations require to use \r\n for a new line instead of simply \n.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Thanks for sharing 🙂
I can see that we have changed our "Description" field years ago to a HTML field rather than the ootb string.
Result is that the following is printed in the description field when the catalog task is created:
<p data-tinymcerootblock
Any ideas on how to work around it?
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
I'm not entirely sure, but you may need to construct the entire value in the whatever the desired target HTML needs to be, so something like:
javascript:"<span>hello world</span></ br>this is the next line.</ br>then the next line.</ br>"
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hey,
I managed to get this to work - You just need to Shift+Enter when adding a new line in the HTML field in the flow designer - Then it actually works! 🙂
https://docs.servicenow.com/bundle/london-platform-administration/page/use/using-forms/concept/c_InsertALineBreak.html
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Nice! Will have to test next time I'm working in Flow Designer.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
thanks so much. This was sooooooo helpful Kev.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi Kev
This was super helpful for me too ... Thanks very much!!!
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Thanks for this - I used it on the Virtual Agent, which worked like a dream!
javascript: "Some text\n\nDescription: {{vaInputs.description}} \n\nSome more text"