Approves not populating using transformmap

Susmitha S
Tera Contributor

Import data using transform map, the data was loaded successfully in customised table. Loaded data is in draft state, now I want to move draft to published manually. While moving the states, should accept approvers approval then only record will go to the published state. 

Now the issue is approvers not assigning it is showing empty field. This approver field is in sysapproval_approver table. 

while creating record manually approvers getting in approvers field but using transform map not assigned approvers. I written transform map scrip also but not worked.

 

can you please give me the suggestions on this. Thank in advance 

4 REPLIES 4

Chaitanya ILCR
Kilo Patron

Hi @Susmitha S ,

is Run business rule checkbox checked on the transform map?

if no check it and try

ChaitanyaILCR_0-1746059648502.png

 

else 

please share more details of transform map and table you are importing into and when should approvals should generate etc,.

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

 

@Chaitanya ILCR  I checked run business rules checkbox but no use. The target table is policy table and when the policy went to the awaiting content approval state, approval trigger for content approvers field persons and same very after approving content approvers it should go to awaiting final approval, final approvers field persons will approve the request. Then only it will go to the published state

 

The approvals logs in related list approvals tab. In the tab it is showing state is requested but approver column shows empty. This approver field is related to sysaaproval_approver table

 

 

Ankur Bawiskar
Tera Patron
Tera Patron

@Susmitha S 

Please share the screenshots of your field map, source data, transform script etc

what debugging did you do? what's the expected outcome?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Susmitha S
Tera Contributor

Hi @Ankur Bawiskar The script I written in transformmap script, here I am pulling the users and this script in onBefore

 

(function transformRow(source, target, map, log, isUpdate) {

    // Helper to resolve comma-separated user names to sys_ids
    function resolveUserList(userNamesString) {
        var sysIds = [];
        if (!userNamesString) return sysIds;

        var names = userNamesString.split(',');
        for (var i = 0; i < names.length; i++) {
            var name = names[i].trim();
            if (!name) continue;

            var userGR = new GlideRecord('sys_user');
            userGR.addQuery('name', name);
            userGR.query();
            if (userGR.next()) {
                sysIds.push(userGR.getUniqueValue());
            } else {
                log.info('User not found for name: ' + name);
            }
        }
        return sysIds;
    }
})(source, target, map, log, action == "update");
 
 
SusmithaS_0-1746071277637.pngSusmithaS_1-1746071357390.pngSusmithaS_2-1746071404742.pngSusmithaS_3-1746071513773.png

 

I need to import bulk record on policy form, after importing the data the record is in draft state. That is expected. but when moving to the published state, need to give approvals. When the policy form went to the awaiting content approval state, the two approvals populating same time and approvers empty. 

Please check and can you give me the suggestions to fix this issue