Hi Team,
i have a card layout and on click of it the section with contents should showup to the user. For this i have added a link on card layout but on first click it doesnot saves value to local!showDetails but on second click it does because of which my section remains hidden on first click and gets visible on second click.It should save value always. The section hide and show under a card is also controlled by an external link ExpandClicked as well. Suggest a way to achieve this.
link: a!dynamicLink( value: if( index( index( index( index( index( ri!final_PRN_CDT.PrnSegment.Providers, 1, {} ), "ServiceLocation", {} ), "Addresses", {} ), ri!index, {} ), "ExpandClicked", false() ) = true(), not(ri!final_PRN_CDT.PrnSegment.Providers[1].ServiceLocation.Addresses[ri!index].ExpandSegment), not(local!showDetails) ), saveInto: { local!showDetails, a!save( ri!final_PRN_CDT.PrnSegment.Providers[1].ServiceLocation.Addresses[ri!index].ExpandSegment, false() ), a!save( ri!final_PRN_CDT.PrnSegment.Providers[1].ServiceLocation.Addresses[ri!index].ExpandClicked, false() ) } )
Discussion posts and replies are publicly visible
1. First thing I would do is figure out why the value loads as empty into the interface.
As a side note your CDT design is very complex where you have 6 levels of nesting (waterfall effect) this is generally an anti-pattern
1. ri!final_PRN_CDT
2. PrnSegment
3. Providers[1]
4. ServiceLocation
5. Addresses[ri!index]
6. ExpandClicked
I would suggest to revisit these links to adjust your design
https://docs.appian.com/suite/help/23.2/cdt_design_guidance.html
https://community.appian.com/w/the-appian-playbook/1199/working-with-advanced-cdt-structures
2. Another simple solution is to simply do something of the sort
a!save( ri!final_PRN_CDT.PrnSegment.Providers[1].ServiceLocation.Addresses[ri!index].ExpandClicked, if( a!isNullOrEmpty( ri!final_PRN_CDT.PrnSegment.Providers[1].ServiceLocation.Addresses[ri!index].ExpandClicked ), true(), false() ) )