Hi There, I was wondering if I could get some clarification around so

Certified Associate Developer
Hi There,

I was wondering if I could get some clarification around something in the documentation here: forum.appian.com/.../Adding_Node_Inputs_and_Node_Outputs

Specifically this statement:
"Expressions for node input values are evaluated before expressions on the form. If the default values of form fields are mapped to node inputs, then they are evaluated at the same time as the node inputs. Therefore, they must not reference other node inputs."

If I'm understanding this correctly this means that input parameters on forms cannot be used for any default values on any forms - however this goes against what I'd thought were several Appian best practices and causes some very significant technical problems when displaying database data on a form.
Can anyone clarify what, exactly, is meant by the above statement and if I've misinterpretted it?...

OriginalPostID-111545

OriginalPostID-111545

  Discussion posts and replies are publicly visible

  • Hi Jin, I think the better way to interpret the documentation is that a default form value cannot rely on other node input expressions. In other words, in one node, default form field value X should not rely on the evaluation of node input Y for its value if they are both in the same node.
  • 0
    Certified Associate Developer
    Hi David,

    I'm not sure I understand how what you said is different from my understanding of the documentation. If I want to display 10 values from a CDT that I fetch from a database I would create a single input parameter, set it's value to the appropriate query rule and then reference that single input parameter from all 10 fields.

    If I understand what you're saying that shouldn't be done and what we have to find a different way of getting the data. Is that correct?
  • I do not believe that is the case.

    The documentation above advises against the following scenario:
    Node Input 1: rule!myQueryRule(),
    Node Input 2: fn!if( isnull(<Node Input1>), true, false)

    The reason for this would be that Node Input 1 and Node Input 2 evaluate at the same time, and therefore Node Input 2 may not return the expected result.

    However, node inputs and form input parameters are not identical things. Node Input 1 and Node Input 2 may both be mapped to form inputs as such without issue regardless of their value:
    rule!mySAILrule(input1: ac!NodeInput1, input2: ac!NodeInput2)
  • 0
    Certified Associate Developer
    Hi Angad, that has always been my understanding as well however the documentation explicitly states:

    'If the default values of form fields are mapped to node inputs, then they are evaluated at the same time as the node inputs. Therefore, they must not reference other node inputs.'

    which is where I'm getting confused - am I misinterpreting the documentation?
  • I think you are interpreting this piece of the documentation as two separate evaluations. What it really means is that the default values ARE the node inputs. If we take the example from my last post:

    rule!mySAILrule(input1: ac!NodeInput1, input2: ac!NodeInput2)

    We can see that the default values are equal to the node inputs. So when the node inputs are evaluated, they will evaluate the default values for the form (even if the form has not begun to evaluate yet). But this does not change best practice and should have no affect on pulling back anything from databases on to forms.
  • The reference to "form fields" in the documentation applies to forms created using the Forms Designer. It needs to be modified for SAIL forms, so we'll update the docs to clarify.

    Jin: Your understanding of the docs is correct when it comes to forms created using the Forms Designer.

    Angad's understanding is correct when it comes to forms created using SAIL Forms.

    With SAIL Forms, we've improved the behavior such that you're able to follow the best practice of querying your data from the database once to populate your CDT, then use it as the default value of each SAIL form field. So to support the use case described in the original post, we recommend that you either switch to using SAIL forms, or query for the data in a separate node before the user input task.

    We'll add the SAIL Form vs. Forms Designer clarification to the documentation.