- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2023 03:42 PM
I normally update historical data in background scripts when necessary.
However, this one is not working as I'd like.
I have an old field which was a list field. I have multiple random combinations of values.
I want to move the data into a new table and new field which is now a singular choice.
I am trying to grab the singles first where I can but I can't get the singles to appear in a query even if I filter to just show "retaliation" I get all the combos that include it as well. Here is the query x_letter_claims!=NULL^x_letter_claims=Retaliation
I was hoping to use a background script like I've normally done but if I can't get the query to come up I am not sure what to do?
For example: I am getting retaliation, gender, disability or retaliation, gender or retaliation. I have many variations and combos and I am not sure what to do. I thought I'd first just try updating the ones that are singular but I can't even get that query to work.
var grAll = new GlideRecord('x_table');
grAll.addEncodedQuery('x_letter_claims!=NULL^x_letter_claims=Retaliation');
grAll.query();
while(grAll.next()) {
grAll.x_claims = 'Retaliation';
grAll.autoSysFields(false);
grAll.setWorkflow(false);
grAll.update();
}
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2023 08:49 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2023 07:59 AM - edited 01-24-2023 09:17 AM
The problem is it shows all kinds of combinations (see screenshot)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2023 12:44 PM
Can you provide some screenshots or any more info on this? Looks like you are working with a custom table so without any more information, it's difficult to help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2023 08:00 AM - edited 01-24-2023 09:17 AM
It is a custom table but it's the way these list/multi-select fields work that's causing the issue. (see screenshot)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2023 08:07 AM
Your screenshot shows that you are filtering for *keyword but you haven't shown us the filter that results, like this:
The * is a wildcard which means you're searching for values that CONTAIN the keyword. That's not the same as EQUALS keyword.
Perhaps you can also tell us more about what kind of field x_letter_claims is. Can you provide the sys_dictionary details for it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2023 08:24 AM - edited 01-24-2023 09:16 AM
When I right click on the list view to - show matching I get the "=" but it still shows the combinations rather than just the singular "retaliation"
The field is a list and it's so hard to work with. This why I am trying to get all of the data out of this field and move it to a choice list instead.
I just can't figure out how to get the data to show up in a way that I can write a script to map it to a new choice list.