I'm struggling to find the correct syntax for saving into a nested CDT from

Certified Lead Developer
I'm struggling to find the correct syntax for saving into a nested CDT from a SAIL dashboard. The snippet below creates a valid paragraph field from my nested CDT value but the saveInto causes an error when updating the form. I am using this style of notation because the elements are generated from an apply function so "IncidentVehicle" and "VehicleMake" are dynamic at runtime. The value will save when hard-coding local!dataArray["IncidentVehicle"].VehicleMake but this isn't an option for me as the .field cannot be parameterized.

a!paragraphField(
label: "CDT Data",
value: index(local!dataArray["IncidentVehicle"],"VehicleMake"),
saveInto: index(local!dataArray["IncidentVehicle"],"VehicleMake")
          )...

OriginalPostID-94523

OriginalPostID-94523

  Discussion posts and replies are publicly visible

Parents
  • Typically, you would store the saveInto into a localVariable, ruleInput or acp. In your case, the saveInto seems to be simply executing the expression function.
    What I suggest you do is this.
    load(
    local!paraField:index(local!dataArray[ ... ] , "VehicleMake") ,
    a!paraField(
    label:"CDT",
    value:local!paraField,
    saveInto: local!paraField << index(local!dataArray["..."], "VehicleMake")

    Having said that, I am not sure why you are saving the same value into saveInto. Ideally, I'd assume you want to save the changes made to the paragraph field into a variable, right? In your case, this data never seems to be used anywhere.

    If your paraField is a readOnly, then you don't need to specify saveInto.

    If your paraField is something user enters and you need to look for that value from the dataArray, then your saveInto expression would change. Having said that, if that be the case, you shoudnt be using the paraField but a drop down that'd be your local!dataArray.

    I hope this is clear.
Reply
  • Typically, you would store the saveInto into a localVariable, ruleInput or acp. In your case, the saveInto seems to be simply executing the expression function.
    What I suggest you do is this.
    load(
    local!paraField:index(local!dataArray[ ... ] , "VehicleMake") ,
    a!paraField(
    label:"CDT",
    value:local!paraField,
    saveInto: local!paraField << index(local!dataArray["..."], "VehicleMake")

    Having said that, I am not sure why you are saving the same value into saveInto. Ideally, I'd assume you want to save the changes made to the paragraph field into a variable, right? In your case, this data never seems to be used anywhere.

    If your paraField is a readOnly, then you don't need to specify saveInto.

    If your paraField is something user enters and you need to look for that value from the dataArray, then your saveInto expression would change. Having said that, if that be the case, you shoudnt be using the paraField but a drop down that'd be your local!dataArray.

    I hope this is clear.
Children
No Data