Expression to show a message based on values in a sub-list - Check all sub-list items have checkbox checked
Original Post by Sandy (Imported from Ardevia Forum)
Hi,
Could you please advise how I can perform this validation.
I have a sub-list that has a column called receipt attached. As each line is added, the user can check this box or leave it unchecked. If they leave it unchecked, I would like to do either of the following:
1 As they add the sub-list line, require that they include an attachment against the sub-list if the receipt attachment is unchecked OR
2 Display a message that advises an attachment is required if not all of the sub-lists have the receipt attached checkbox checked.
Thanks
Sandy
-
Original Post by Liliia (Imported from Ardevia Forum)
Hi Sandy,
As far as I understand from the second case, you want just to shown a message that an attachment is required if at least one of the Receipt Attached checkbox is unchecked.
For this:
1) add a new action with 'Show message' type for example on Save button;
2) add Condition expression:=[[@SubLists.YourListName.Receipt_x0020_Attached]].filter(function(el){ return !el;}).length3) provide message details;
4) add opposite Condition expression on 'Save Form' and 'Redirection' actions to not allow saving with unchecked 'Receipt Attached':Code:
=![[@SubLists.YourListName.Receipt_x0020_Attached]].filter(function(el){ return !el;}).length0 -
Original Post by Sandy (Imported from Ardevia Forum)
Awesome.....that worked perfectly.
Thank You
0
Please sign in to leave a comment.

Comments
2 comments