call the script include from the flow

Mounika280
Tera Contributor

How can I call GRCUtils().generateProfiles(current, true) in a custom action in Flow Designer? I am trying to create a custom action that functions similarly to the 'Update Entities from Filter' feature.

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

@Mounika280 

you can use script step in custom flow action and ensure you pass the correct GlideRecord object in that function

what did you try and what didn't work?

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

@Ankur Bawiskar 
we have otb functionality on entity type which generates profile/Entities .
trying to add this script include in the flow.
created custom action:

(function execute(inputs, outputs) {
    if (currentRecord) {
        var scriptIn = new GRCUtils().generateProfiles(currentRecord, true);
        gs.info('Generated Profiles: ' + JSON.stringify(scriptIn));
        currentRecord.is_manual_processing = false;
        currentRecord.update();
        outputs.updated = true;
    }
})(inputs, outputs);