To save with variable in save() function

Hi,

 

I want to save one variable which i created in with and values of that variable are getting update on basis of drop down.

I am using that variable(dataset) further to display something. But when i am trying to save any value in that dataset.

 

I am getting error

Expression evaluation error in rule 'rule_Test' (called by rules 'rule_test1' > 'rule_test2') at function a!applyComponents [line 176]: An error occurred while executing a save: Expression evaluation error: The save target must be a load() variable, process variable, or node input (or a rule input passed one of those three), but instead was:

 

What i sthe workaround to save the values of with variable instead to use load one as error says. 

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer
    in reply to sauravk
    I'm a little unclear still what you're trying to accomplish, but with() variables are NOT meant to be saved into directly - they are meant only to automatically evaluate based on changes (if applicable) in the data in their original definitions. Hence why you're getting the error message which is expected.
  • Then in my case how will i achieve my goal.
    I need to compare data dynamically. I mean first time if i select anything in with than i am preparing this dataset which i am passing to another rule under grid layout(Under new with) where i am comparing two field values , but my validation is working with existing values in dataset, but when i enter new value in both fields which is not available in that dataset, than i am getting this error as i am trying to save this value in this dataset.
  • Then in my case how will i achieve my goal.
    I need to compare data dynamically. I mean first time if i select anything in with than i am preparing this dataset which i am passing to another rule under grid layout(Under new with) where i am comparing two field values , but my validation is working with existing values in dataset, but when i enter new value in both fields which is not available in that dataset, than i am getting this error as i am trying to save this value in this dataset.
  • Then in my case how will i achieve my goal.
    I need to compare data dynamically. I mean first time if i select anything in with than i am preparing this dataset which i am passing to another rule under grid layout(Under new with) where i am comparing two field values , but my validation is working with existing values in dataset, but when i enter new value in both fields which is not available in that dataset, than i am getting this error as i am trying to save this value in this dataset.
  • 0
    Certified Lead Developer
    in reply to sauravk
    I'm not clear what exactly you're trying to do - can you start out by explaining your use case at a more high level?

    It looks like you're trying to directly edit a data set, and in that case the usual method is to query the original data in-process, and pass it into your SAIL form via a rule input (ri!) variable. Your editable grid is then free to save changed values into the ri! variable, which in this case acts similar to a load() variable. You would then save any changes back to the database in your process model after the form is submitted.

    (Also: in the case where your reply accidentally gets submitted multiple times, you can click the "More" link under the comment body and "Delete" on the extra copies.)
  • 0
    Certified Lead Developer
    in reply to sauravk

    Also, just as a suggestion, where you do this:

    saveInto: {
    ri!masterDataSet[ri!index].nameCopy,
    a!save(
    ri!masterDataSet[ri!index].nameCopy,
    upper(
    ri!masterDataSet[ri!index].nameCopy
    )
    )
    }

    You could replace this with simply:

    saveInto: {
      a!save(
        ri!masterDataSet[ri!index].nameCopy,
        upper(save!value)
      )
    }