How to print each array element in new line
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2024 10:46 AM
Hello experts,
I'm querying to sys_approver table and collecting all the approver comments for that particular RITM.
I'm going while loop and adding all comments to array. I'm getting the values in comma separated values which is like paragraph. Instead of getting comments in paragraph I need each comment in new line
How to print each Array element ( comments) in new line
Need suggestions here. Thanks in advance ☺️
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2024 12:07 PM
This works in Background script
But im passing the values in HTML type of field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2024 02:48 PM
OK. You are not showing what you are doing, so I don't see why this wouldn't work. You have one string of comments with a date/time/user header, then a new line, then the comment, then two new lines, and it repeats, so split into an array on '\n' and get the elements you want into a HTML field or whatever.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2024 05:42 PM
Use the script posted before that adds the \n\r,.and instead of adding \n or \n\r just add <br /> for a new line.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2024 12:22 PM
Hi Imran,
Would you try replacing it with "\n" to "<br>" as you are saying it is of HTML field type.
Please mark helpful, it it works for you.
Thanks,
Suman.