Can you do an 'insert' in Flow Design to update records?

Winnie P
Mega Sage

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.  

WinnieP_0-1696197725745.png

 

4 REPLIES 4

AnveshKumar M
Tera Sage
Tera Sage

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 👍✅

Thanks,
Anvesh

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.

DanielCordick
Mega Patron
Mega Patron

Hi Winnie,

 

Yes it’s possible, you would need to create your own action to accomplish this 

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.