I am trying to get a sheet to pick the lowest of two numbers, one of which is inside a repeating field . Is it possible? This works outside a repeating field: on("change:strength change:strength_rank change:maximum_dice_pool sheet:opened", function() {
getAttrs(['strength', 'maximum_dice_pool'], function(values) {
setAttrs({
strength_1: (Math.floor(Math.min.apply(null, Object.values(values))))
});
});
});
but I can't get this to work with something inside a repeating field: on("change:repeating_skillsanew:skill1_total change:maximum_dice_pool sheet:opened", function() {
getAttrs(['repeating_skillsanew_skill1_total', 'maximum_dice_pool'], function(values) {
setAttrs({
repeating_skillsanew_skill1_rating_1: (Math.floor(Math.min.apply(null, Object.values(values))))
});
});
});
Any ideas?