- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-02-2023 08:07 AM
Hi folks,
I have a question about which approach is correct.
Staging table is populated with fields from the JSON payload using a script (below is a just example)
var gr = new GlideRecord('u_test_staging_table');
gr.initialize();
gr.u_ids = result.d.results[i].ids;
gr.u_user_name =result.d.results[i].user_name;
gr.insert();
I need to get count for comments for each user name from the payload and would like to add that number directly to the staging table. Since I do not have a specific field to store the count in the payload, I need to create a custom field directly in the staging table.
Is creating a custom field of type integer (u_number_of_comments) in the staging table a good approach? Or maybe there is another solution for this case?
From import set table I will be using transform map to map this value to target table.
I have also though about using GlideDBUtil APi but not sure if this is necessary (my script will be triggered daily)
GlideDBUtil.createElement(tableName, elementLabel, elementName, sType, sLength, refTableName, createDictionaryItem, usePrefix);
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-02-2023 11:42 PM
No issues with adding a custom field to your specific import table at all as far as I am concerned. This should not even be a licensing concern either, so I would just go with that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-02-2023 11:42 PM
No issues with adding a custom field to your specific import table at all as far as I am concerned. This should not even be a licensing concern either, so I would just go with that.