Hi,
I have One Array in local variable.
like
data=[type:Opportunity,Name:Dickenson Mobile Generators,Account:[type:Account,Name:Dickenson plc],Amount:15000.0]; [type:Opportunity,Name:United Oil Office Portable Generators,Account:[type:Account,Name:United Oil & Gas Corp.],Amount:125000.0]; [type:Opportunity,Name:Express Logistics Standby Generator,Account:[type:Account,Name:Express Logistics and Transport],Amount:220000.0]; [type:Opportunity,Name:GenePoint Standby Generator,Account:[type:Account,Name:GenePoint],Amount:85000.0]; [type:Opportunity,Name:Grand Hotels Kitchen Generator,Account:[type:Account,Name:Grand Hotels & Resorts Ltd],Amount:15000.0], identifiers=1; 2; 3; 4; 5]
and want to store this five opportunity data in rule input to insert into the Appian Cloud Database separately(Five row in appian Cloud Database) after clicking on submit button or on load of form.
to implement this i created one rule input like:
but after clicking on submit button i get the all data in rule input five time with merge data . like
and i need this data in rules input in five time with different values like
code on submit button:
so how i can do this.
Discussion posts and replies are publicly visible
Hi Gawali,
Please check out the code below. Here the testCdt is your CDT.
load( local!testVar: { /* Your Data */ data: { { type: "Opportunity", Name: "DickensonMobileGenerators", Account: { type: "Account", Name: "Dickensonplc" }, Amount: 15000.0 }, { type: "Opportunity", Name: "UnitedOilOfficePortableGenerators", Account: { type: "Account", Name: "UnitedOil & GasCorp." }, Amount: 125000.0 }, { type: "Opportunity", Name: "ExpressLogisticsStandbyGenerator", Account: { type: "Account", Name: "ExpressLogisticsandTransport" }, Amount: 220000.0 }, { type: "Opportunity", Name: "GenePointStandbyGenerator", Account: { type: "Account", Name: "GenePoint" }, Amount: 85000.0 }, { type: "Opportunity", Name: "GrandHotelsKitchenGenerator", Account: { type: "Account", Name: "GrandHotels & ResortsLtd" }, Amount: 15000.0 } }, identifiers: { 1, 2, 3, 4, 5 } }, a!buttonLayout( secondaryButtons: { a!buttonWidget( label: "submit", saveInto: { a!save( ri!testCdt, a!forEach( items: local!testVar.data, expression: { name: fv!item.Name, accountName: fv!item.Account.Name, amount: fv!item.Amount } ) ) } ) } ) )
Hope this helps!