Issue with changing an array rule input

Certified Associate Developer

I am trying to adjust the rule inputs of an interface of my first Appian App. More specifically, I just changed the rule input, but somehow am not able to see all the entries of the data type "person" which is supposed to have all the entries displayed in the preview. Interestingly, the auto-completion in the Expression mode works.

Is this behavior intended? How do I adjust the rule inputs so that it shows the the actual sub-entries of my datatype, similar to https://youtu.be/aJXle5ftPM8?t=593?

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer

    Can you provide some clarification on a few points?

    • What did you change about the rule input? 
      • Specifically, what was it set to before and what is it set to now?
    • What worked differently prior to this change?
    • What are you expecting to have happen?  What are you seeing instead?
    • Additionally, if you can share the code for your interface (please use 'Insert' --> 'Insert Code' functionality), that would help us troubleshoot any apparent issues.
  • It looks to me like you need to choose a CDT as the type for your rule input. That will show the individual fields below that you can save into. Here's an example of what that looks like: 

    If that's not your issue, like Mike said above, please provide more information about what you have tried so far.

  • I think what your issue is (if I've read and interpreted your comments and screen-shot)...is that you've changed the rule input for ri!person from a single value to an array, but the interface is designed only to show a single person value. You'll need to re-design the interface accordingly. You can do this in two ways:

    1. drop the current layout and use a grid instead where each column is an person attribute and each row is a person instance
    2. build repeating layouts as they;re currently designed, based upon the number of instances of ri!person, using a!forEach()

    (If I've misunderstood your problem then perhaps you can elaborate a bit further)

  • 0
    Certified Associate Developer
    in reply to Mike Schmitt

    I created the form as a template from a data type, but I had to delete the data type as I struggled with updating the Appian cloud DB table. Anyhow:

    1. I deleted the rule input which was automatically generated via the template and added a new one using the little plus sign. Before it was something like similar to the following:

    Afterwards I do not see this sub-entries any more.

    2. I do not understand your question. But the underlying motivation for changing the rule input was that I changed the datatype to account for data base model changes, since the DB did not update automatically (it is has to do with capital letters and underliners I am using, but I fixed that with the XSD-download-upload-trick)

    3. I hope (1) clarifies that.

    4. The code of the interface is the following:

    a!formLayout(
      label: "POC - Mini App",
      instructions: "Create record.",
      contents: {
        a!columnsLayout(
          columns: {
            a!columnLayout(
              contents: {
                a!textField(
                  label: "First Name",
                  labelPosition: "ABOVE",
                  value: ri!person.first_name,
                  saveInto: ri!person.first_name,
                  validations: {
                    null
                  }
                ),
                a!dropdownField(
                  label: "Gender",
                  labelPosition: "ABOVE",
                  placeholderLabel: "--- Select a Value ---",
                  choiceLabels: {"Female", "Male",
                    "Other"},
                  choiceValues: {1, 2,
                    3},
                  saveInto: {},
                  saveInto: ri!person.gender_id,
                  validations: {}
                ),
                a!dropdownField(
                  label: "Title",
                  labelPosition: "ABOVE",
                  placeholderLabel: "--- Select a Value ---",
                  choiceLabels: {"none", "Dr.",
                    "Prof.",
                    "Prof. Dr."},
                  choiceValues: {1, 2,
                    3,
                    4},
                  saveInto: ri!person.title_id,
                  validations: {}
                )
              }
            ),
            a!columnLayout(
              contents: {
                a!textField(
                  label: "Last Name",
                  labelPosition: "ABOVE",
                  value: ri!person.last_name,
                  saveInto: ri!person.last_name
                ),
                a!textField(
                  label: "Nobility Particle",
                  labelPosition: "ABOVE",
                  value: ri!person.nobility_particle,
                  saveInto: ri!person.nobility_particle
                )
              }
            )
          }
        )
      },
      buttons: a!buttonLayout(
        primaryButtons: {
          a!buttonWidget(
            label: "Submit to DB",
            icon: "database",
            submit: true,
            style: "PRIMARY"
          )
        },
        secondaryButtons: {
          a!buttonWidget(
            label: "Cancel",
            value: true,
            saveInto: ri!cancel,
            submit: true,
            style: "NORMAL",
            validate: false
          )
        }
      )
    )

  • 0
    Certified Associate Developer
    in reply to Peter Lewis

    Sorry for not being clear: That's exactly what I tried to do, namely to create a new input called person of custom data type fgPerson which has exactly the sub-entries shown in the code snippet above.

    The curious thing is, that editing the expression of the interface definition shows me the corresponding sub-entries of "person" as pull-down-list, only in the rule-input pane on the upper right, the child entries are missing, and I have no clue how to add them. I just know, it looked different before.

  • 0
    Certified Lead Developer
    in reply to fgrl

    What is the data type of ri!person?  From your initial screenshot it looks as if it's set to be an array, which it shouldn't be.  And also it would be nice if we can confirm that it's set as a CDT with the proper fields, in accordance to how your on-form saves are configured.

  • 0
    Certified Associate Developer
    in reply to Mike Schmitt

    It was a CDT and it was supposed to be one after re-inserting a new variable. I played with an array, so that's the confusing screen-shot came about. Sorry for that.

  • +1
    Certified Associate Developer

    As workaround, I ended up re-creating a new interface from scratch, using the "Create from data type" template. All customization to the form were obviously lost, but thanks to the expression mode easy to copy to the new interface.

    Thanks for all your input!