I have created a formula which is quite complex and not easy to read. I would like to optimize the code but I am stumbling against a potential stupid syntax issue. I will post here the code. NOTE: this code is working properly but it is not so easy to read and process
...other operations are done above...
if (CONTAINS(configured_teams_Tools, summary),
WITH error_message = CONCAT(error_message; IF (summary = "SIL" and NOT(match(children_list_text ; "*CS_*")); "CS ")):
WITH error_message = CONCAT(error_message; IF (summary = "SIL" and NOT(match(children_list_text ; "*RA_*")); "RA ")):
WITH error_message = CONCAT(error_message; IF (summary = "SIL" and NOT(match(children_list_text ; "*TU_*")); "TU ")):
WITH error_message = CONCAT(error_message; IF (summary = "TERM" and NOT(match(children_list_text ; "*TEG_*")); "TEG ")):
WITH error_message = CONCAT(error_message; IF (summary = "CTF" and NOT(match(children_list_text ; "*System Definition Verifier*")); "SDV ")):
WITH error_message = CONCAT(error_message; IF (summary = "CTF" and NOT(match(children_list_text ; "*Modeling Framework*")); "MF ")):
NOT(match(children_list_text ; "*FABRIC*")); "FABRIC ")):
IF(
error_message != "", CONCAT("{panel:bgColor=#FF6666}Missing: " , error_message, "{panel}"), CONCAT("{panel:bgColor=#59B161}OK (",children_count ,"){panel}")
)
,CONTAINS(configured_teams_Core, summary),
... does similar checks as described above ...
I would like to optimize such code in a way that looks like
if (CONTAINS(configured_teams_Tools, summary),
IF (summary = "SIL")
WITH error_message = CONCAT(error_message; IF (NOT(match(children_list_text ; "*CS_*")); "CS ")):
WITH error_message = CONCAT(error_message; IF (NOT(match(children_list_text ; "*RA_*")); "RA ")):
WITH error_message = CONCAT(error_message; IF (NOT(match(children_list_text ; "*TU_*")); "TU ")):
IF (summary = "TERM")
WITH error_message = CONCAT(error_message; IF (NOT(match(children_list_text ; "*TEG_*")); "TEG ")):
IF (summary = "CTF")
WITH error_message = CONCAT(error_message; IF (NOT(match(children_list_text ; "*System Definition Verifier*")); "SDV ")):
WITH error_message = CONCAT(error_message; IF (NOT(match(children_list_text ; "*Modeling Framework*")); "MF ")):
IF(
error_message != "", CONCAT("{panel:bgColor=#FF6666}Missing: " , error_message, "{panel}"), CONCAT("{panel:bgColor=#59B161}OK (",children_count ,"){panel}")
)
,CONTAINS(configured_teams_Core, summary),
... does more checks as described above ...
if you have also suggestions on how to improve also the assignment to error_message, feel free to address your observation!
Thanks