Changing a rule input variable in a child interface changes it in the parent but SAIL in local variable doesn't?

Certified Associate Developer

Just a question regarding the exact location and order that variable data is saved in.  I have noticed that saving a variable in a child interface that was passed into it as a rule input also changes the related local variable in the parent interface, which is normal functionality that is explained in several tutorials.  However I also noticed that saving a set of identical SAIL code into a local variable and then changing another local variable results in no change.  

For example if a dropdown option like this were selected it immediately resets the variable, local!madeFromCDT, back to the default:

local!madeFromCDT: cast( typeof(type!("arbitraryType"), {abitraryField: null}))),

local!sailInterfaceDropdown: a!sideBySideLayout(
     item: rule!nestedDropdownfield(
          choiceLabels: local!listOfYesNo
          choiceValues: local!listOfYesNo
          value: index(
               local!madeFromCDT,
               "arbitraryField"
          saveInto: a!save(
               local!madeFromCDT,
               updatedictionary(
                    dictionary: local!madeFromCDT,
                    fieldsAndValues: {arbitraryField: save!value}
               )
          )
     )
)

However, using a expression rule does permanently change the local variable, local!madeFromCDT:

local!madeFromCDT: cast( typeof(type!("arbitraryType"), {abitraryField: null}))),
rule!sameSAILDropDownButInExpressionRule(
     madeFromCDT: local!madeFromCDT
)



  Discussion posts and replies are publicly visible

Parents Reply Children