- 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 08:49 AM
Try adding a condition for does not contain comma:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2023 09:05 AM
Thank you. I think this will work for what I need.
Any suggestions for how to get the unique combinations to group together?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2023 08:32 AM
I know how to do a background script for this. I do it all the time.
The problem is just I can't get the data to show up good in a query so I can have everything match up.
How can I get just retaliation to show up and not all the other combinations? That is my issue.