saveInto is not working ?

Hi ,

saveInto is not working for the below code

a!paragraphField(
label: "Comment",
value: ri!comments,
instructions: "(" & 255 - len(ri!comments) & ")",
saveInto: a!save(ri!comments, save!value),
refreshAfter: "KEYPRESS",
validations: rule!PDR_validateTextOnSize(enteredText: ri!comments, size: 255),
required: true(),
readOnly: false()
)

when I write anything in paragraph field the value is not save.

  Discussion posts and replies are publicly visible

Parents
  • Works for me:

    (obvs I had to comment out your validation rule as I don't have access to it but this shouldn't have any effect on how it works)

  • But for me it is not working, i have done the same thing which you have mentioned

  • One possibility occurs to me. Does this code work natively in your Interface Designer but not work when your testing it in a User Interface as part of a Process model?

  • Hah!! Ok, context is everything!!! That's a key piece of information that we needed to address this (just for future reference!)

    So, firstly, some concepts that will help you understand how this all hangs together so you'll be better placed to solve this yourself in the future:

    1. In User Interface and Expression Rule objects, Rule Inputs are pointers to variables, and not variables in their own right. That is, you have to have an actual variable outside of your object where the data is actually stored. This is key! (what confuses people initially is that when working in the Designer environment Appian makes variables for you so you can test the object but at run-time you need to have mapped your rule input to an actual piece of memory defined by a variable)
    2. When you have a User Interface in a Process Model, the User Interface sits "inside" the User Input Task. The User Interface's rule inputs nee to be mapped to variables called "Activity Class" variables - that is, those you define in the 'data' tab of the User Input Task. This is where the data is stored when the User Interface sends it to a rule input.
    3. Not only this, but if you need that data in the Process you also have to map it from the Activity Class variable to a process variable. Think of an Activity Class variable as "private" to the User Input Task, and the Process Variable global to the entire process. The data won't get out of the User Input Task's variable unless you explicitly instruct it to "save Into" a pv! from the Data tab

    Hopefully that should help you understand why the data you're entering into your paragraph field is disappearing - it isn't being stored anywhere!

Reply
  • Hah!! Ok, context is everything!!! That's a key piece of information that we needed to address this (just for future reference!)

    So, firstly, some concepts that will help you understand how this all hangs together so you'll be better placed to solve this yourself in the future:

    1. In User Interface and Expression Rule objects, Rule Inputs are pointers to variables, and not variables in their own right. That is, you have to have an actual variable outside of your object where the data is actually stored. This is key! (what confuses people initially is that when working in the Designer environment Appian makes variables for you so you can test the object but at run-time you need to have mapped your rule input to an actual piece of memory defined by a variable)
    2. When you have a User Interface in a Process Model, the User Interface sits "inside" the User Input Task. The User Interface's rule inputs nee to be mapped to variables called "Activity Class" variables - that is, those you define in the 'data' tab of the User Input Task. This is where the data is stored when the User Interface sends it to a rule input.
    3. Not only this, but if you need that data in the Process you also have to map it from the Activity Class variable to a process variable. Think of an Activity Class variable as "private" to the User Input Task, and the Process Variable global to the entire process. The data won't get out of the User Input Task's variable unless you explicitly instruct it to "save Into" a pv! from the Data tab

    Hopefully that should help you understand why the data you're entering into your paragraph field is disappearing - it isn't being stored anywhere!

Children