- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-26-2024 08:42 PM - edited ‎09-26-2024 09:04 PM
Hi All,
Actually before caste field was string and recently i made this a choice field so the value entered before is not present in my choices now. So i want those values should be populated in other caste field and caste field should become others which is present in my choices.
I have a choice field for caste and it has already contained some existing records . Also i have string field named "other caste" to enter data manually when user selects others in caste field. Now i want to populate the existing records which contains data out of the options in choice field i.e on caste field, to be populated in the string field named 'other caste' and make choice field (caste field) as others.
Thank you
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-26-2024 09:35 PM
Hi @Community Alums ,
Does the 'Caste Field' still holds the string value even after changing the field type. You can write a BG script to populate the values.
Try this script:
var grTable = new GlideRecord('table_name');
grTable.addEncodedQuery('filter');//use the filter in list view and copy the query.
grTable.query();
while (grTable.next()) {
if (grTable.caste_field) {
grTable.other_caste = grTable.caste_field;
grTable.update();
}
}
Regards,
Dhanraj.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-29-2024 10:37 PM
Ahh!! Are those records have "caste_field" not empty? Because we have condition, which will restrict the "caste_field" empty records from updating.
Did you give the correct filter? Not sure what is missing. Did you see anything different for those records?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2024 11:15 AM - edited ‎10-12-2024 11:13 PM
I run this script using setWorflow(false),it was working fine . But i don't know why i am getting unexpected result on those updated records since a few days . Is it possible to get previous record as it was before ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-15-2024 04:21 AM
Hi @1_DipikaD ,
Can you please elaborate what is the exact issue you are facing? and I believe reverting back all those records will be a complex logic to perform.
Regards,
Dhanraj.