Return values from script include
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2023 04:38 AM
In a catalog item there is a field lets say ids where the ids of the user i selct form sys_user table will be populated.
The field names where i enter users lets suppose entered as a,b, c, d . and the output (ids)i get from these will be like a,c,d,b . The order is messing . Can someone help with this i am using script include.
while (record.next()) {
for (var i = 0; i < fields_len; i++) {
arr.push(record.getValue([i]));
}
}
return arr.join(" , ");
},
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2023 05:39 AM
@Anurag Tripathi : Thanks for the reply. So i cannot change the sequence but only append its key to value in the response.
But the response field needs to bepopulated only with value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2023 06:07 AM
When you return the value in this format -> usr3#id3,usr4#id4,usr2#id2,usr1#id1
Or Json
Then your client script you can extract this and know which id is for which username and populate accordingly, there is not dependency on sequence then.