Skip to main content
March 25, 2024
Question

Number of Field Types

  • March 25, 2024
  • 4 replies
  • 0 views

Hi Everyone,

I have field which has values "a", "b", "c" and I need to get the count of these values in record types. Can anyone please help me with this.

    4 replies

    karumurua531442
    March 25, 2024

    hi [mention:bb176b67c26c4e89b2173f39160c9f46:e9ed411860ed4f2ba0265705b8793d05]   are you saving a,b,c values in one column in table ?can you check this code and let me know

    length(split(local!data['recordType!recordname.fieldname],","))

    kalpeshg0081
    March 25, 2024

    Hi [mention:bb176b67c26c4e89b2173f39160c9f46:e9ed411860ed4f2ba0265705b8793d05] , if i have understood your question correctly, you can create the custom record field in the record type and use the Aggregation function to count the occurrence of "a", "b", "c".

    March 26, 2024

    sum(split({1,2,3},","))

    replace {1,2,3} to pass the field you are referring to

    marioo5689
    March 26, 2024

    Hi [mention:bb176b67c26c4e89b2173f39160c9f46:e9ed411860ed4f2ba0265705b8793d05]  I would like to get more information about what you are trying to achieve.

    *are you trying to save the values on differente record types or just one record type?

    *what is the input values are you receiving on your field ? if comma its present.

    for now I can give you a possible solution:

    Rule: 

    a!localVariables(
      local!textField, 
      {
        a!sectionLayout(
          contents: {}
        ),
        a!sectionLayout(
          label: "Field Values Into Record Types",
          contents: {
            a!textField(
              label: "Field",
              labelPosition: "ABOVE",
              value: local!textField,
              saveInto: local!textField,  
              refreshAfter: "UNFOCUS",
              validations: {}
            ),
            a!buttonArrayLayout(
              buttons: {
                a!buttonWidget(
                  label: "Save",
                  value: ri!theRecord,
                  saveInto: a!save(ri!theRecord, length(split(local!textField, ","))), 
                  submit: true,
                  style: "OUTLINE"
                )
              },
              align: "START",
              marginBelow: "NONE"
            )
          }
        )
      }
    )

    Interface: 

    Results:

    I hope this works for you, greetings.