- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2023 04:08 AM
I have a variable called approvals.
On which i show all the list of approvals who approved that current case.
as of now i am seeing data as
approver1. approver2. approver3. approver4
But i want the data to be shown as
approver1
approver2
approver3
approver4
for info i am using an array to store this data, so could it be possible to achieve this functionality with in array? should i take a new approach?
Please suggest
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2023 10:21 AM
Is that a dot or a comma, I can't tell. Try this instead:
rec.variables.first_approver = approversList.join("");
To convert the array to a string by specifying the character that comes between the members. If it doesn't like this (no character), try taking the '\n' out of the push then join the array on "\n".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2023 07:00 AM
Try this first - it will either work, or you'll see '\n' after the short description:
approversList.push(gr.approver.getDisplayValue() + ' - ' + gr.short_description) + '\n';
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2023 08:12 AM
yeah, it didn't work.
Can you suggest how can i achieve this with some changes in my script please?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2023 08:34 AM
Hello Brad,
I was able to get the approvers as a list but i am getting a dot in the beginning even though i didn't used any dot.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2023 10:21 AM
Is that a dot or a comma, I can't tell. Try this instead:
rec.variables.first_approver = approversList.join("");
To convert the array to a string by specifying the character that comes between the members. If it doesn't like this (no character), try taking the '\n' out of the push then join the array on "\n".