Script to set True/False RITM field not working

Kenneth Zabrisk
Tera Guru

I'm attempting to update a True/False field on the RITM within a Flow Designer flow for the item and have encountered an unusual behavior.

If I directly set it by using the checkbox on the flow (see attachment Checkbox) the rendered code is:

u_account_not_applicable=true

and the field is set correctly on the RITM.
 
However, if I use a script in the flow to set the field on the RITM (see attachment ScriptView):
 
/*
**Access Flow/Action data using the fd_data object. Script must return a value.
**example: var shortDesc = fd_data.trigger.current.short_description;
**return shortDesc;
*/
var answer = 'false';
if (fd_data._1__get_catalog_variables.parent_account ==''){
answer = 'true';
}
return answer;
 
the rendered code is the same:

u_account_not_applicable=true
 
but it does NOT set the field on the RITM.
 
********************************************************
 
Any help much appreciated as this is driving me nuts.
1 ACCEPTED SOLUTION

Hitoshi Ozawa
Giga Sage
Giga Sage

Hi Kenneth,

Try removing the quotes around "true" and "false". I tried it in my flow and was able to check the "Account does not apply" field.

i.e.

var answer = false;
if (fd_data._1_get_catalog_variables.parent_account == '') {
  answer = true;
}
return answer;

View solution in original post

4 REPLIES 4

sachin_namjoshi
Kilo Patron
Kilo Patron

You will need to create a custom action to update catalog item variable in flow designer.

Check below for solution

 

Update Variable Action

 

Regards,

Sachin

 

Kenneth Zabrisk
Tera Guru

Thank you, but I'm not updating catalog variables, just fields on the RITM.  I'll correct the title as I was not precise enough in distinguishing my issue.

Hitoshi Ozawa
Giga Sage
Giga Sage

Hi Kenneth,

Try removing the quotes around "true" and "false". I tried it in my flow and was able to check the "Account does not apply" field.

i.e.

var answer = false;
if (fd_data._1_get_catalog_variables.parent_account == '') {
  answer = true;
}
return answer;

Kenneth Zabrisk
Tera Guru

Hitoshi, thank you, using

answer = true;  rather than   answer = 'true';

worked!

 

What I find peculiar is that in checking both the flow that sets the value (no quotes on true) and the one that doesn't ('true'), the rendered code is is identical in both cases:  

u_account_not_applicable=true

So I'm left wondering how it could behave differently.