We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

Custom field in Import set table

miro2
Mega Sage

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);

 

 

1 ACCEPTED SOLUTION

laszloballa
Administrator

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.

View solution in original post

1 REPLY 1

laszloballa
Administrator

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.