react-awesome-query-builder icon indicating copy to clipboard operation
react-awesome-query-builder copied to clipboard

Force unique/mandatory field definition within group

Open jadhavsaurabh opened this issue 3 years ago • 2 comments

Screenshot from 2021-07-01 19-22-55

For above rule we have a configuration like this,

results: {
      label: "Results",
      type: "!group",
      subfields: {
        product: {
          type: "select",
          fieldSettings: {
            listValues: ["abc", "def", "xyz"],
          },
          valueSources: ["value"],
        },
        score: {
          type: "number",
          fieldSettings: {
            min: 0,
            max: 100,
          },
          valueSources: ["value"],
        }
      }
    }

Is there any option to make all the subfields compulsory and user can not select duplicate subfields?

for example we can have such properties avoidDuplicate: true & mandateSubfields: true. If both of these properties are true then user will not be able to see plus icon right besides Results field input as he has to enter all the values and there will not be individual delete button on the subfields.

jadhavsaurabh avatar Jul 01 '21 14:07 jadhavsaurabh

Similar to https://github.com/ukrbublik/react-awesome-query-builder/issues/244

ukrbublik avatar Jul 01 '21 16:07 ukrbublik

Is any update on force unique field? I need same feature . please help me how to solve it .

nageshwari17 avatar Apr 14 '22 15:04 nageshwari17