In the grid I am getting the same plan name whatever plan I select in the dropdown , Can anyone help me fix this?
a!localVariables( local!wmsPlans: index( rule!WMS_qr_Plan( columns: { 'recordType!{a64248d4-beb2-46af-9f5f-eb0f79b17649}WMS PLAN.fields.{f39ad615-5340-4968-8dd2-3b4d81474095}planName', 'recordType!{a64248d4-beb2-46af-9f5f-eb0f79b17649}WMS PLAN.fields.{a8baeebc-1ffb-4f0a-9096-d148777d3756}planId' }, clientId: 11, planStatus: "Active" ).data, {} ), local!vetRequestPlans: index( rule!VET_qr_RequestPlans_ByFilters(requestId: 1188 ), {} ), local!additionalCITplans, local!plansSelected, local!editablePlans: if( length(a!flatten(local!plansSelected)) > 0, reject( fn!isnull, { a!forEach( items: local!vetRequestPlans, expression: if( contains( local!plansSelected, fv!item['recordType!{9339afa7-3440-42ac-9d18-6e89a7c891b4}VET Request Plans.fields.{0a9f63be-0169-4a60-b003-5fbc6b8ab22b}planId'] ), fv!item, null() ) ), local!additionalCITplans } ),{}), local!newPlans: {}, local!finalPlans, local!confirmationMessage: null, a!sectionLayout( label: "Rider A Plan", contents: { /* Dropdown to select plans from WMS */ a!multipleDropdownField( choiceLabels: a!forEach( local!wmsPlans, fv!item['recordType!{a64248d4-beb2-46af-9f5f-eb0f79b17649}WMS PLAN.fields.{f39ad615-5340-4968-8dd2-3b4d81474095}planName'] ), choiceValues: a!forEach( local!wmsPlans, fv!item['recordType!{a64248d4-beb2-46af-9f5f-eb0f79b17649}WMS PLAN.fields.{a8baeebc-1ffb-4f0a-9096-d148777d3756}planId'] ), label: "Select Plan(s)", instructions: "Choose one or more plans to include", value: local!plansSelected, saveInto: { local!plansSelected, a!forEach( items: local!vetRequestPlans, expression: { if( contains( local!plansSelected, fv!item['recordType!{9339afa7-3440-42ac-9d18-6e89a7c891b4}VET Request Plans.fields.{0a9f63be-0169-4a60-b003-5fbc6b8ab22b}planId'] ), a!save( target: fv!item['recordType!{9339afa7-3440-42ac-9d18-6e89a7c891b4}VET Request Plans.fields.{1757e6bb-8aa8-40c1-a6e4-e19bf1d6997c}citPlan'], value: "Y" ), a!save( target: fv!item['recordType!{9339afa7-3440-42ac-9d18-6e89a7c891b4}VET Request Plans.fields.{1757e6bb-8aa8-40c1-a6e4-e19bf1d6997c}citPlan'], value: null() ) ) } ), /*Populate additional plans selected at task level*/a!save( target: local!additionalCITplans, value: rule!VET_formatPlans( newPlans: local!plansSelected, requestId: ri!vetRequestMaster['recordType!{bcf01859-d047-4a18-9bcd-d22f5777cfc4}VET Request Master.fields.{01ed6269-0ba1-4f80-b8b3-b4480cc94eed}requestId'], oldPlans: local!vetRequestPlans, clientId: ri!vetRequestMaster['recordType!{bcf01859-d047-4a18-9bcd-d22f5777cfc4}VET Request Master.fields.{c5f29ec0-9886-4ee7-9228-98a6a42acf28}clientId'] ) ) } ), /* Editable Grid for Selected Plans */ if( length(a!flatten(local!plansSelected)) > 0, a!gridLayout( label: "Edit Selected Plan Names", headerCells: { a!gridLayoutHeaderCell(label: "Plan Name"), }, columnConfigs: { a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight: 8), }, rows: a!forEach( items: local!editablePlans, expression: a!gridRowLayout( id: fv!index, contents: { a!textField( label: "Plan Name " & fv!index, value: if( a!isNullOrEmpty( local!editablePlans[fv!index]['recordType!{9339afa7-3440-42ac-9d18-6e89a7c891b4}VET Request Plans.fields.{a1d9bcaf-fedd-4524-91a7-1f43dd80dc4f}planname'] ), index( index( local!wmsPlans, wherecontains( local!plansSelected, fv!item['recordType!{9339afa7-3440-42ac-9d18-6e89a7c891b4}VET Request Plans.fields.{0a9f63be-0169-4a60-b003-5fbc6b8ab22b}planId'] ), {} ), 'recordType!{a64248d4-beb2-46af-9f5f-eb0f79b17649}WMS PLAN.fields.{f39ad615-5340-4968-8dd2-3b4d81474095}planName', {} ), local!editablePlans[fv!index]['recordType!{9339afa7-3440-42ac-9d18-6e89a7c891b4}VET Request Plans.fields.{a1d9bcaf-fedd-4524-91a7-1f43dd80dc4f}planname'] ), saveInto: local!editablePlans[fv!index]['recordType!{9339afa7-3440-42ac-9d18-6e89a7c891b4}VET Request Plans.fields.{a1d9bcaf-fedd-4524-91a7-1f43dd80dc4f}planname'], required: true ), } ) ), rowHeader: 1 ), {} ),
Discussion posts and replies are publicly visible
As an aside, this is why I always insist other devs I work with use index() only for finding indexes, and when they want to get a property, such as you seem to be doing with the index() call on line 121, use the property() function, if for no other reason than code clarity / readability...