- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2020 10:13 AM
I am new to Flow Designer.
I created a catalog item that if approved will create a new Knowledge Base(create record action in Flow). There is an oob Business Rule that auto inserts the Can Read record(users with snc internal role). I have 2 other actions to Create a new User Criteria, and Who Can read...thus I want to delete that initial can read record.
On the "Delete Record" action at the field, "Record" I created the inline script:
var kb = fd_data._3_2_1__create_record.record.sys_id
var can = new GlideRecord('kb_uc_can_read_mtom');
can.addQuery('kb_knowledge_base', kb);
can.addEncodedQuery('user_criteria=d2d2e20557130300d873ac71ef94f9aa');
can.query();
if(can.next()){
return can.sys_id;
}
I have tried to pass other returns e.g.:
*Return true;
*Var sid = can.sys_id;
Return sid;
This doesn't work. I even tried can.deleteRecord() and this will correctly delete the record(so i know my query is right) but will get an error in the Flow context which obviously makes sense since this delete function is already built in this action.
Anybody have recommendations for this script or should I use something other than the Delete Record action?
Solved! Go to Solution.
- Labels:
-
flow designer

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2020 10:59 PM
Instead of writing inline script you can use Lookup Record action step and fetch the record of your need.
Then in Delete Record step bring the data pill of this Lookup Record step.
For e.g.
Please mark correct & help if that works.
Regards
Deepen shah
aavenir.com

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2020 12:38 PM
Hi ,
Here is a link which will help you.
If it helps,Please mark ✅ Correct and ???? Helpful.
Warm Regards,
Milind

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2020 10:59 PM
Instead of writing inline script you can use Lookup Record action step and fetch the record of your need.
Then in Delete Record step bring the data pill of this Lookup Record step.
For e.g.
Please mark correct & help if that works.
Regards
Deepen shah
aavenir.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2020 05:28 AM
Thank you. I wasn't aware of that lookup record action but it worked.