Hello, I have editable grid where I'm trying to save all the selections in rule input after that I will use the rule input to push the data to database. The problem is that I'm not able to save the multi drop down as an array when I select more then one option it save only one and not all in the rule input.
Full code below:
rows: a!forEach( items: ri!AOS_Documents_Required, expression: a!gridRowLayout( id: fv!index, contents: { a!dropdownField( choiceLabels: {"Option 1", "Option 2", "Option 3", "Option 4", "Option 5", "Option 6", "Option 7", "Option 8", "Option 9", "Option 10", "Option 11", "Option 12"}, choiceValues: {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}, label: "Dropdown", labelPosition: "ABOVE", placeholder: "--- Select a Value ---", value: fv!item['recordType!{c80b9de7-a15f-41db-8c92-5cb6b7aa7ce3}AOS_Documents_Required.fields.{cc6533a6-0073-472b-a61d-99d1171e7c3a}Region'], saveInto: fv!item['recordType!{c80b9de7-a15f-41db-8c92-5cb6b7aa7ce3}AOS_Documents_Required.fields.{cc6533a6-0073-472b-a61d-99d1171e7c3a}Region'], searchDisplay: "AUTO", validations: {} ), a!dropdownField( choiceLabels: {"Option 1", "Option 2", "Option 3", "Option 4", "Option 5", "Option 6", "Option 7", "Option 8", "Option 9", "Option 10", "Option 11", "Option 12"}, choiceValues: {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}, label: "Dropdown", labelPosition: "ABOVE", placeholder: "--- Select a Value ---", value: fv!item['recordType!{c80b9de7-a15f-41db-8c92-5cb6b7aa7ce3}AOS_Documents_Required.fields.{5166be0a-f7de-4498-854d-437c347c4372}Country_Template'], saveInto: fv!item['recordType!{c80b9de7-a15f-41db-8c92-5cb6b7aa7ce3}AOS_Documents_Required.fields.{5166be0a-f7de-4498-854d-437c347c4372}Country_Template'], searchDisplay: "AUTO", validations: {} ), a!multipleDropdownField( choiceLabels: {"Option 1", "Option 2", "Option 3", "Option 4", "Option 5", "Option 6", "Option 7", "Option 8", "Option 9", "Option 10", "Option 11", "Option 12"}, choiceValues: {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}, label: "Dropdown", labelPosition: "ABOVE", placeholder: "--- Select a Value ---", value: fv!item['recordType!{c80b9de7-a15f-41db-8c92-5cb6b7aa7ce3}AOS_Documents_Required.fields.{2e3c19f3-cbac-4d92-a67d-b7d18703a862}SDS_Language'], saveInto: fv!item['recordType!{c80b9de7-a15f-41db-8c92-5cb6b7aa7ce3}AOS_Documents_Required.fields.{2e3c19f3-cbac-4d92-a67d-b7d18703a862}SDS_Language'], searchDisplay: "AUTO", validations: {} ), a!richTextDisplayField( value: a!richTextIcon( icon: "close", link: a!dynamicLink( saveInto : a!save( ri!AOS_Documents_Required, remove(ri!AOS_Documents_Required, fv!index) ) ), linkStyle: "STANDALONE", color: "NEGATIVE" ) ) } ) ), selectionSaveInto: {}, addRowLink: a!dynamicLink( label: "Add new", saveInto: a!save( ri!AOS_Documents_Required, append( ri!AOS_Documents_Required, 'recordType!{c80b9de7-a15f-41db-8c92-5cb6b7aa7ce3}AOS_Documents_Required'() ) ) ), validations: {}, shadeAlternateRows: true
Discussion posts and replies are publicly visible
The simple answer is you probably won't be able to save multiple values into a single-value field in a single row of a CDT / RecordType data, depending I suppose on how you have the "SDS_Data" property of your record type configured.
But it's saving if you use local variables, so I can save multiple values in single multi drop property. I'm using Records and it's setup like this:
Shwapx said:But it's saving if you use local variables
Local variables (depending on what you're trying) can slightly more easily store arrays inside variables inside parent arrays - this is usually not as easy to do with CDT data however.
So what I should do, how I can proceed with this? Isn't this the essential of Appian to be able to work with records, how to submit the form when I need the data in rule input to be able to submit it via process model? I think I'm not getting something, I have the ability to use multi drop down, but I don't have the ability to save the values from it?
Generally we don't store multiple values in a single field of a single row of a record / CDT. Or are you saying "SDS_Language" is actually configured as an array within your record type setup?
Actually how to setup it as an array in my record type setup, because I don't see that option. I've just created the records using the interface. And they are all integers since the dropdown choices are with numbers, so 1 will be "Option 1", 2 will be "Option 2".. of course that data will be changes later on. So in SDS_Language i want to store for example 1,2 which will be Option 1, Option 2 and also the other 2 columns which are single dropdown selection which works fine and it's saved properly in the rule input.
Is it just writing to a single column in the DB table? Because if so, it can't really easily hold multiple values. You'd need to set up a link table or something.
Shwapx said:Actually how to setup it as an array in my record type setup
I'm not actually sure that's possible. Are you able to show a screenshot of the configuration of the associated DB table?
Here is the table:Now I have requestID as relation ship with another table which will eventually store all of the information for single request. So for single request I can have multiple documents rows. And I have one to many relationship.
So you're trying to use a Multiple Dropdown for "SDS_Language". But for each row of your db / record, it is a single ID. That means each row can store a single associated ID, meaning you can't use a multiple dropdown for it (which explains why it isn't working).
If each "document" (row) needs to hold many "SDS Language" IDs, then you'd need to make a separate table to hold each instance of a Language ID and the Document ID it belongs to. I assume there's a way to use Record Relationships to make managing this on the front-end a bit faster, though I haven't used that functionality enough myself yet to provide much specific assistance there.
But Isn't multiple dropdown supposed to make array which means have all the values in one field so it will be 1 row even if you have multiple dropdown. Or I guess it's not working like that. I'm now curious of how people use multiple dropdown it seems weird.