- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-22-2024 08:16 PM
Hi Team,
We have a requirement to concatenate 2 fields on Incident table and store that in a new custom field. Now, an export set needs to be created to export the data from incident table including this new field. I have created a new field with calculated value, of calculation type 'formula' and the formula provided is "CONCATENATE(field1, " ", field2)"
Now when I am trying to export data from this table using export set, the new field is shown empty.
What might be the reason ?
One reason I can think of is the calculated value is just calculated real time and data is not really stored in database in order for the export set to pick it up. If this is the case, how about to achieve this functionality ?
Thanks,
Gopi
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2024 04:51 PM
Hi Team,
I was able to understand the issue later, with help from ServiceNow support team. The issue was because, I created calculated value field after most of the records in the table were created. Hence the value shown in the calculated value field was only in UI but not saved to the database.
For the above mentioned issue, ServiceNow support team suggested to just make some small update to each record, which will save the calculated value to the database. I did the same by using a fix script to update all records and that did the job!
For any newly created records, this issue is not there as the calculated value is already written to the database when the record is saved or updated.
Sharing this information here, hope this will be helpful for someone facing similar issue in future.
Thanks & Regards,
Gopikrishnan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-22-2024 11:08 PM
Hi @Gopi22 ,
If you want to update the value in the new field, use gr.update() method if you are using background script or fix script.
if you are using a business rule written in the incident table, you can use before BR to write the script (dont have to use current.update()).
Please let me know how you are updating the value in the table.
Note: Please Mark this Helpful and Accepted Solution. If this Helps you to understand. This will help both the community and me.
Regards,
Deborah Brown
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2024 07:43 AM
Hi Deborah,
I am using 'calculated value' for the field. Setting the calculation type to 'formula' and the formula is mentioned as below:
CONCATENATE(field1, " ", field2)
This seems to be working as I can see new field with concatenated value from field 1 & field 2 on the table. But when I select the same table in an export set, this new field is going empty.
Thanks,
Gopi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2024 04:51 PM
Hi Team,
I was able to understand the issue later, with help from ServiceNow support team. The issue was because, I created calculated value field after most of the records in the table were created. Hence the value shown in the calculated value field was only in UI but not saved to the database.
For the above mentioned issue, ServiceNow support team suggested to just make some small update to each record, which will save the calculated value to the database. I did the same by using a fix script to update all records and that did the job!
For any newly created records, this issue is not there as the calculated value is already written to the database when the record is saved or updated.
Sharing this information here, hope this will be helpful for someone facing similar issue in future.
Thanks & Regards,
Gopikrishnan