- 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-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-26-2024 10:20 PM
Fix script ?
@dhanrajb
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2024 11:44 PM
Yes, Ofcourse you can do this in fix script
Regards,
Dhanraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2024 03:16 AM
I have run the fix script,it is working for most of the records but for a few records it is not working.
I have checked BR but still did not find any developments for these records.