Has anyone been able to implement multiple saves within a dynamicLink created by applyComponents?

Has anyone been able to implement multiple saves (list) within a dynamicLink created by applyComponents? My use case: I have a pie chart with links, which open a grid below for dta based on which section is clicked. Aside from saving the desired item, I also need to reset pagingInfo at the same time. Reason being, if the child grid is paged over to a startIndex greater than the next item's datasubset, an error is thrown. E.g., if pagingInfo startIndex is currenty 16 and you click another section of the grid which returns only 12 items, an error is generated - so, you need to reset paging when changing the filter. When I use the commented code below, the chart links will ALWAYS reference/populate local!filter with the first item in the value list. I also noted, if I simply add brackets {} around the local!filter variable within saveInto (second commented line below), the same issue is seen - clicking any section will populate local!filter with th...

OriginalPostID-177388

OriginalPostID-177388

  Discussion posts and replies are publicly visible

  • ...e first item in the value list. Removing the brackets, all works as expected. Thoughts/suggestions welcome.

    a!pieChartField(
    instructions: "",
    label: "Functional Area Breakdown",
    series: {
    a!applyComponents(
    a!chartSeries(label: _, data: _, links: _),
    merge(
    local!functionalAreas,
    local!countArray,
    a!applyComponents(
    /*a!dynamicLink(label: _, value: _, saveInto: {local!filter, a!save(local!pagingInfo,local!pagingInfo_default)}),*/
    /*a!dynamicLink(label: _, value: _, saveInto: {local!filter}),*/
    a!dynamicLink(label: _, value: _, saveInto: local!filter),
    merge(
    local!functionalAreas,
    local!functionalAreas
    )
    )
    )
    )
    }
    )
  • This sounds like AN-58764, fixed in 7.11.
    forum.appian.com/.../Appian_Release_Notes.html

    Assuming you're on an earlier version, could you try wrapping your a!dynamicLink in a rule? In other words, create a rule that takes in a label, value, filter, pagingInfo and anything else you need to save, and use applyComponents to loop over that? That was the pre-7.11 workaround.
  • I think we cant do Multiple saves in dynamiclink, we had same issue and we have fixed this using multiple with().
    but in your case i am not sure multiple with() feasible..
  • We are facing the exact same issue. We are in 7.9. We couldn't find a workaround and currently implemented without paging (batchSize as -1). Its a monthly volume report and we have huge data .. the report itself takes few seconds to load for the first time .. And slow everytime we change the filter ..We will try the workaround by "Tyler" (Glad that its fixed in 7.11).

    @Shiva : Can you please explain a bit more on your approach. Or paste your code here .. I am not getting how you are using multiple with() to achieve this ..
  • Actually we have paging grid with dynamic field on ID.
    when user clicks on ID we are storing entire row in a datasubset and try to store in other local variable using a!save in sveInto. In this case we faced two issues
    1.The data is not stored in second variable.
    2. When user clicks on other id the pv still showing old data which is selected previously(this is when we have multiple stores).

    so to avoid this in dynamic link we are storing in single pv and based on selection using some appian functions like displayvalue we are storing required data in second variable.

    Hope you got it !!
  • Got it Shiva . Thanks .. Anyways for us, wrapping the a!dynamicLink in a rule worked perfectly ..
  • 0
    Certified Lead Developer
    Hope this solution works for the current use case:
    Create an expression rule for the a!dynamicLink configure the required attributes with saveInto multiple and then call the rule in the SAIL UI, with this you can update multiple variables at a single shot.
  • Great, thanks All. I was able to resolve my issue by wrapping dynamicLink within a rule.

    a!applyComponents(
    a!chartSeries(label: _, data: _, links: _),
    merge(
    local!functionalAreas,
    local!countArray,
    a!applyComponents(
    rule!WRS_reportFunctionalAreas_link(
    value: _,
    filter: local!filter,
    pagingInfo: local!pagingInfo,
    pagingInfo_default: local!pagingInfo_default
    ),
    local!functionalAreas
    )
    )
    )

    rule!WRS_reportFunctionalAreas_link:

    a!dynamicLink(
    label: ri!value,
    value: ri!value,
    saveInto: {
    ri!filter,
    a!save(ri!pagingInfo,ri!pagingInfo_default)
    }
    )