Solved

Condition to hide panel using Calculated Value on Repeating Section field

  • 20 June 2019
  • 2 replies
  • 70 views

I have two problems both of which are interlinked in a Travel Authorisation form that I am building.

I am attempting to hide a security warning message when a city field in a repeating section contains a security level and present the security message inside the Security Warning.

 

There is a list of Countries with columns for every city (used for cascading lookup below), where applicable each city has an associated Security Level assigned (calculated value circled in red below) and security comment (calculated value circled in Green below)

 

The requirements are to

a) Only show the Security Warning when a city contains a security level

- multiple cities are selected below and the security level is presented in an array [3,,1] 

b) Present the Security Message as 

KABUL - Please get approval from CFO

ORAN - Please get approval from the Budget Holder

instead of [KABUL - Please get approval from CFO,#Value!,ORAN - Please get approval from the Budget Holder]

 

I would need to remove the blank values "#Value!," and remove the square blackets "[ ]" and replace remaining commas with a line break if possible.

 

2683iBD1A452C210C4A57.png

 

All calulkated fields will eventually be hidden using CSS, 

 

I do believe this is possible using replace() but I have tried the inArray(0 with little success.

 

Appreciate any help here thanks

Chet

 

 

icon

Best answer by burked 25 June 2019, 17:34

View original

2 replies

Userlevel 5
Badge +8

Hi @ChetChudasamaTS,


 


I answered your question in the link below:


https://community.nintex.com/t5/Nintex-Workflow-Cloud/Way-to-remove-the-square-brackets-and-quotation-marks-from-a/m-p/96874/highlight/true#M629



This should hopefully provide the info you're looking for!


 


Thanks,
Dan

Hi @burked 


 


I was a little creative and used the security level array [3,,1] and added a rule to hide the security warning when NamedControl==0. This was effective.


Then last Friday, I ended up using JavaScript to iterate through the security message calculated field


[KABUL - Please get approval from CFO,#,ORAN - Please get approval from the Budget Holder] Named control - calcArSecMessageandComment - JavaScript Variable "varSecMessagesID" (I replaced any blank values with #)


to be output to SecurityWarningComments multi line text field - JavaScript Variable - "varMessageTextBox"


// varMessageTextBox = SecurityWarningComments
// varSecMessagesID = calcArSecMessageandComment


var SecMessagesID = NWF$('#' + varSecMessagesID);
SecMessagesID.change(function()
{
var arrayContent = SecMessagesID.val();
arrayContent = arrayContent.replace('[','');
arrayContent = arrayContent.replace(']','');
arrayContent = arrayContent.replace(new RegExp(',#','g'), '');
arrayContent = arrayContent.replace(new RegExp(',','g'), '
');


NWF$('#' + varMessageTextBox).val(arrayContent);
});


Thanks for your help and I may have worked around the issue I'm having with a different post - https://community.nintex.com/t5/Nintex-for-Office-365/Nintex-Forms-for-Office-365-set-cascading-lookup-filter-in-RS/m-p/96417#M11311


but now I need to find a way of copying the Repeating Section and its nested repeating section to a duplicate in the same form


 


Cheers


Chet

Reply