While importing using transform map, how to set value for String field having choice list?

prabhasgupte
Kilo Expert

I am importing some data using Import Set table and transform map. Data is being imported into cmdb_ci_computer table. This table have two fields (os and discovery_source) of type String, but both have choice list associated with them.

Now, when I create a field map for each of them, my source field is of type String (without choice list) and target field is of type String (with choice list). The Choice Action is set to "create".

When the transform happens, I get error message Invalid Table assignment to the Choice record.

If I set Choice Action to "ignore", I don't get this error, but it neither sets value. I must set the value there.

How can I get rid of this error?

1 ACCEPTED SOLUTION

prabhasgupte
Kilo Expert

Answering my own question, because I got hold of it and could figure out what was actually going wrong.



One encounters this error when you are trying to add those choice list from any scope other than "Global" scope. If you switch to "Global" scope and do the same thing (mentioned in question), you will not see that error message and even the choice list will have the desired value.


View solution in original post

6 REPLIES 6

So here is my question for you,



you were doing import in scoped app?



if so what did you do to overcome this issue.



And it work good in global scope rite without modification?


Yes Ashutosh.


I insert records into Import Set table from scoped application, which then get transformed into cmdb_ci_computer records.



As I mentioned in my answer above, the issue was with the scope from which choice list options were getting added. They MUST come from Global scope.


So, even if you are inserting data into Import Set tables from scoped application, the data which you are inserting MUST belong to Global scope. (Yes, that sounds weird, I know, but that's how it is in servicenow -- the table can belong to application scope, but records in that table can belong to Global or any other scope.)



If your scope matches with the scope of choice list, you will not see the mentioned error. Otherwise, you encounter it.



In my case, a scheduled job brings data into source table. And, a client action triggers the inserts into Import Set tables.


The schedules were created by user from Global scope (because that's the default scope they have). So when schedule executes, the records created in source table belong to Global scope (and NOT to application scope). Thus, scope of records being inserted into Import Set table and scope of OS/Discovery Source choice lists matches and I don't see that error any more.



You need not do any change in your app for this to work.