Merge pull request #6109 from Budibase/bug/sev2/automation-trigger-save-multiselect

Automation validation - convert array string to array type
This commit is contained in:
melohagan 2022-06-01 13:23:51 +01:00 committed by GitHub
commit 81ad54acaa
1 changed files with 3 additions and 0 deletions

View File

@ -64,6 +64,9 @@ exports.validate = async ({ tableId, row, table }) => {
// Validate.js doesn't seem to handle array
if (type === FieldTypes.ARRAY && row[fieldName]) {
if (row[fieldName].length) {
if (!Array.isArray(row[fieldName])) {
row[fieldName] = row[fieldName].split(",")
}
row[fieldName].map(val => {
if (
!constraints.inclusion.includes(val) &&