Can you do an 'insert' in Flow Design to update records?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-01-2023 03:04 PM
Hello there, just checking to see if it's possible to do an 'insert' in Flow Design. Can you use Flow to insert/add (not update) 'Knowledge' type for multiple Groups (about 95 groups). We tried 'update' action but it wipes existing group 'type' & using 'Update selected' does the same. Anyone know best methods to action the above please, without wiping existing entries? Current Flow below is what we have so far, thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-01-2023 03:25 PM
Hi @Winnie P
If it is a one time action, you can use a background script or fix script to update the type values without erasing the existing types. For example,
var gr = new GlideRecord('sys_user_group');
gr.addEncodedQuery('typeLIKE1cb8ab9bff500200158bffffffffff62^typeNOT LIKE2e763549d7111100828320300e61038d^active=true'); // Please change this query as per your requirement, In groups list view apply the filters as per your need and copy the query , replace this query with the copied one
gr.query();
while(gr.next()){
var types = gr.getValue('type') + '';
if(types.length > 31){
types = types + ',458de4f067671300dbfdbb2d07415ad6';
} else {
types = '458de4f067671300dbfdbb2d07415ad6';
}
gr.setValue('type', types);
gr.update();
}
Please mark my answer helpful and accept as solution if it helped you 👍✅
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2023 11:12 AM - edited ‎10-09-2023 11:41 AM
Appreciate your time to reply Anvesh. I will check out your solution, however it would be good to also know if we could use Flow Design. Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-01-2023 07:14 PM
Hi Winnie,
Yes it’s possible, you would need to create your own action to accomplish this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2023 11:31 AM
Thank you for your time to reply DC. Do you have any steps/instructions to follow to create this new action in Flow Designer? Regards.