Error getting saving a value of two fields.
Hello Folks,


Followed by above screenshots: I have two fields (dropdown and text). Text field comes up when click on plus icon.
Scenario: Dropdown field contains company name. There is a possibility to add manual company name. That's why plus icon will be placed and on click of that shows up text field. I have column in a database called companyName that saves value.
Issue here is: Both field saves value into same "saveInto" which conflicts. When I fills up text field it shows dropdown error because value saves into same companyName column. Please see below code.
a!localVariables(
local!company: false(),
a!dropdownField(
choiceLabels: local!CompanyLabels,
choiceValues: local!CompanyLabels,
label: "company name:",
labelPosition: "ADJACENT",
placeholder: "Select Choice",
value: tostring(index(ri!company, "companyName", {})),
saveInto: ri!company.companyName,
disabled: if(
toboolean(not(local!company)),
false,
true
),
),
a!textField(
label: "Manual company Name",
value: ri!company,
saveInto: {
ri!company,
a!save(ri!company.companyName, save!value)
},
labelPosition: "ADJACENT",
showWhen: if(toboolean(local!company), true, false),
)
)