Hide Parameter value using Javascript

Hi,

I have created a parametrized task where I have passed multiple parameter the problem is parameter which I want to be fixed & hidden they are not working.

I am able to control their value as hidden in task description but the moment I am taking action, action show everything which was hidden in action parameter listing with other parameters.

I tried below to make them hidden after action creation & listing them under parameters values, below code doing the job but its actually printing “hidden” when I am doing action script to print parameter values.

var CMDCode = document.getElementById("CMDCode").style.visibility="hidden";
var CMDCode1 = document.getElementById("CMDCode1").style.visibility="hidden";

Fixed & hidden parameter value in task description -

Visible parameter value post action execution other than what I have putted in code
image

Below is the actual parameter values in code.

<?hxlat CMD_Code ?> MyHiddenCodeHERE <?hxlat CMD_Code1 ?> MyAnotherHiddenCodeHere

However if I remove these parameter from below they will not show but the problem is after removing them task does understand if these are parameter exists or not.

TakeFixletAction(Relevance('id of current fixlet'), Relevance('id of current bes site'), "Action1", {CMDCode:CMDCode, CMDCode1:CMDCode1});

Any thoughts or suggestions, please.

1 Like

That’s pretty advanced stuff, congratulations!

You should in that case use TakeSecureFixletAction() , which also provides a dictionary for the Secure Parameters. Those parameters get encrypted before sending the action (so you cannot dynamically-target, the endpoint’s public keys need to be available when you create the action).

2 Likes

Thank you Jason :slight_smile:

This function worked like charm !!! no more visible parameters… yippeeee :slight_smile:

1 Like

@JasonWalker one more query, how to handle multiple sub actions within it?

in this task I have 3 actions (Action1, Action2, Action3), if I go with Action1 its going very well but the moment I choose Action2 or Action3 to execute its going back to Action1 script & open action window for that.

TakeSecureFixletAction (Relevance('id of current fixlet'), Relevance('id of current bes site'), "Action1", {}, { CMDCode1:CMDCode1, });

However I also handled that by creating 2 two additional TakeSecureFixletAction code like below & its doing the job, now I am able to execute Action1, Action2, Action3 with same parameter but different action script.

TakeSecureFixletAction (Relevance('id of current fixlet'), Relevance('id of current bes site'), "Action2", {}, { CMDCode1:CMDCode1, });

TakeSecureFixletAction (Relevance('id of current fixlet'), Relevance('id of current bes site'), "Action3", {}, { CMDCode1:CMDCode1, });

Now the only problem is, if I select Action2 or Action3 for execution subsequently their earlier action window will also open in the background. Like I took action3 but action1 & action2 window will also automatically open & if I do action2 for execution Action1 window will also open, as of now I am just closing the background window but if anyone dont know this behavior they will be taking all three actions in confusion.