Hello,
I would like to set a comment as required depending on a value of a data table. Is it possible to make this requirement dependent on a business rule? If so, how would I proceed here?
Thank you very much!
Hello,
I would like to set a comment as required depending on a value of a data table. Is it possible to make this requirement dependent on a business rule? If so, how would I proceed here?
Thank you very much!
Hi,
I am not sure if it's possible using the regular comment section.
However, you can emulate its behavior using a multi-line text field.
Just enable the append mode in the field configuration.
By then adding a business rule to the requiredness restriction of the field you'll be able to toggle it.
In the example from my screenshot, I just check if any rows in the example table have the value true for a specific column, based on that rule the text field becomes mandatory.
Hi,
there's also an alternative using the "Additional path validation form rule".
In my example I created field which defines, whether a comment is necessary or not.
If this is true another form rule is executed. This form rule returns true or false depending on the value in the comment field. This form rule is of type JavaScript:
return document.querySelector("textarea[aria-label='Comments'").value ==''
If this returns false, an alert is displayed.
Remarks:
a) This solution will only work, if the comment is visible.
b) The part "textarea[aria-label='Comments'" may be different in your version. I'm using WEBCON BPS 2025
c) The false and true in the "Additional path validation form rule" will prevent or allow the path transition.
In your case you don't have the "Comment required" field but you could create one and set it to "technical" field. During the page load you could execute a form rule which sets the value of this field using a business rule.
Best regards,
Daniel
Hi,
I know it's a workaround but you can also make two almost identical paths (one with required comment, one without) and show/hide them depending on the business rule result.
Regards,
Jacek
Hi,
there's also an alternative using the "Additional path validation form rule".
In my example I created field which defines, whether a comment is necessary or not.
If this is true another form rule is executed. This form rule returns true or false depending on the value in the comment field. This form rule is of type JavaScript:
return document.querySelector("textarea[aria-label='Comments'").value ==''
If this returns false, an alert is displayed.
Remarks:
a) This solution will only work, if the comment is visible.
b) The part "textarea[aria-label='Comments'" may be different in your version. I'm using WEBCON BPS 2025
c) The false and true in the "Additional path validation form rule" will prevent or allow the path transition.
In your case you don't have the "Comment required" field but you could create one and set it to "technical" field. During the page load you could execute a form rule which sets the value of this field using a business rule.
Best regards,
Daniel
Hi Daniel, thanks for your idea! Apparently the value of the “aria-label” changes when the user's language changes. I have extended the JS accordingly, but it's not really professional. Do you have any suggestions for improving this?
const com1 = document.querySelector("textarea[aria-label='Kommentar']")?.value === '';
const com2 = document.querySelector("textarea[aria-label='Comments']")?.value === '';
const isEmpty = com1 || com2;
return isEmpty;
Hi Daniel, thanks for your idea! Apparently the value of the “aria-label” changes when the user's language changes. I have extended the JS accordingly, but it's not really professional. Do you have any suggestions for improving this?
const com1 = document.querySelector("textarea[aria-label='Kommentar']")?.value === '';
const com2 = document.querySelector("textarea[aria-label='Comments']")?.value === '';
const isEmpty = com1 || com2;
return isEmpty;
Hi Marc,
I only checked the 2025 version and in this version we can use the first part of the id "SEL_SystemComments_xyz" to get the text area.
document.querySelector("div[id^='SEL_SystemComments'] textarea").value == ""
If this does not exist in your version, you can create a business rule of type "Text" and provide the different translations of the "Comments" label.
https://daniels-notes.de/posts/2024/translations#business-rule-function-text
Best regards,
Daniel
Hi Marc,
I only checked the 2025 version and in this version we can use the first part of the id "SEL_SystemComments_xyz" to get the text area.
document.querySelector("div[id^='SEL_SystemComments'] textarea").value == ""
If this does not exist in your version, you can create a business rule of type "Text" and provide the different translations of the "Comments" label.
https://daniels-notes.de/posts/2024/translations#business-rule-function-text
Best regards,
Daniel
Hi Daniel, thanks for your reply! That works great :)