How can I update a catalog variable in Flow Designer

Taha_Alawadhi
Giga Contributor

Hey guys,

I need your help!
I am trying to update a catalog variable in the middle of a workflow using flow designer

find_real_file.png

 

I don't see an OOB option to do that and when I tried this script as an action it didn't work. I am getting the variable value, but it won't change it 

 

find_real_file.png

 

Thanks!

1 ACCEPTED SOLUTION

Taha_Alawadhi
Giga Contributor

I just found the solution
Way simpler than I thought

 

find_real_file.png

View solution in original post

6 REPLIES 6

Taha_Alawadhi
Giga Contributor

I just found the solution
Way simpler than I thought

 

find_real_file.png

Hi Taha,

I have a query regarding to flow designer, My requirement is to set the variable value in RITM for the specific Catalog Item.

I created the trigger as Service Catalog, Action Get Catalog Variable from HR Job Profile (Catalog Item). And selected all the variables there too. But got stuck in the step to set the variable's value.

Suppose, I have a checkbox variable i.e. "ABC" and like to set "True".

I tried with Run Script but still no luck.
var nameOfABCVariable = fd_data._1__get_catalog_variables.abc.getName();

gs.log("abc name: " + nameOfABCVariable);

In log, it's printing as undefined.

However, if I used like this then it returns as true even it is not defined by the user in the RITM record.
var nameOfABCVariable = fd_data._1__get_catalog_variables.abc;

gs.log("abc name: " + nameOfABCVariable);

Therefore, could you please guide or help in setting this up or is there any example available then kindly share.

Quick help must be appreciated.

rmlpz
Tera Contributor

There is a even simpler way, in your case:

 

(function execute(inputs, outputs) {
  inputs.ritim.variables.request_type = 'revoke_all_access';
  inputs.ritim.update();
})(inputs, outputs);

sherixi
Mega Contributor

this is still within the flow designer?  I am also looking for a way to UPDATE catalog variable.