- 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-20-2023 10:45 AM
Anyone have any ideas?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2023 12:12 PM
How did you get/generate the encoded query? You can try filtering your list in the list view first and then copying the encoded query from that filter's encoded query once you have visually verified the results. Example:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2023 12:30 PM
This is the problem. In the list view I am getting all kinds of combinations even when I try to filter just on one such as "retaliation" if I filter to just show retaliation it shows all combinations that include it. No matter how I filter it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2023 01:01 PM
How about CONTAINS Retaliation?