- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2025 12:57 PM
Hello everyone ,
I have a JOSN of watchlist users , in some case those can be multiple so i need to store there names and emails in a string type field ',' separated.
{
"size": 4,
"start": 0,
"limit": 50,
"isLastPage": true,
"_links": {
"self": "--------------------",
"base": "------------------",
"context": ""
},
"values": [
{
"accountId": "-----------------------------------------",
"emailAddress": "This 1",
"displayName": "This 2",
"active": true,
"timeZone": "Asia/Calcutta",
"_links": {
"Rest": "------------------------------",
"avatarUrls": {
"48x48": "------------------",
"24x24": "---------------------",
"16x16": "--------------------",
"32x32": "-------------"
},
"self": "------------------"
}
},
{
"accountId": "-------------------------",
"displayName": "This 3",
"active": true,
"timeZone": "Asia/Calcutta",
"_links": {
"jiraRest": "-----------------------",
"avatarUrls": {
}
}
]
}
like above JSON we have 2 display names
so I need to store them in one string field "," separated.
In my current flow I'm getting the last name of the participant , earlier one getting override.
Can anyone suggest me the correct way to achieve this.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2025 12:00 AM
You can use the scripted option of the update step to concatenate the values, think something like
yourVariable += yourVariable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2025 12:00 AM
You can use the scripted option of the update step to concatenate the values, think something like
yourVariable += yourVariable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2025 12:17 AM
I tried something like this
(function transformWatchList(userString) {
if (!userString) {
return '';
}
var userNames = userString.split(',');
var sysIds = [];
var userGR = new GlideRecord('sys_user');
for (var i = 0; i < userNames.length; i++) {
var userName = userNames[i].trim();
if (userName) {
userGR.addQuery('user_name', userName);
userGR.query();
if (userGR.next()) {
sysIds.push(userGR.sys_id.toString());
}
}
}
return sysIds.join(',');
})(inputs.user_string);
But that is not working as expected.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2025 12:29 AM
does it work at all or just partly?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2025 12:05 AM
@Hristo Ivanov thank you for the approach I had used flow var for the same.
Now there is one thing after getting the comma seperated users name / emails I want to add those names in case table watch list , but as the type is watch list how can I make sure to add single single participants in watchlist.
Using the flow while doing fields mapping .