Expression evaluation error [evaluation ID = DD2TAAGA] in rule ‘ibs_referencetableibsrefrfld' (called by rule ‘ibs_referencetables') at function a!dropdownField [line 312]: A dropdown component [label=“FLD_ID”] has an invalid value for “value”. All selected values must be present in the choiceValues array, but value was 56 and choiceValues was 1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16; 17; 18; 19; 20; 21; 22; 23; 24; 25; 26; 27; 28; 29; 30; 31; 32; 33; 34; 35; 36; 37; 38; 39; 40; 41; 42; 43; 44; 45; 46; 47; 48; 49; 50; 51; 52; 53; 54; 55; 56.
Discussion posts and replies are publicly visible
Not to be a naysayer, but this isn't a lot of context.
You meat not enough information?
Correct. I can't speak for others, but without some additional context (such as, at least a relevant snippet of your SAIL code, preferably showing your dropdown definition as well as where you're sourcing the values you're showing), I could only make blind guesses as to what the issue is.
Also, the thread subject line of just the word "Error", isn't going to give potential viewers of the thread from the message board front page any clue as to what the issue is. It doesn't have to be super long or anything, but a brief summary of your issue is always advisable.
You're right. I knew just the word "Error" was a mistake but couldn't edit it.
a!cardLayout( contents: { a!columnsLayout( columns: { a!columnLayout( contents: { a!cardLayout( contents: { a!columnsLayout( columns: { a!columnLayout( contents: { a!dropdownField_20r2( label: "Field ID", placeholderLabel: "Please Select", choiceLabels: a!forEach( items: {local!totalRowList}, expression: if(fv!index < (local!totalRowIndex + 1 - local!newRowCount), fv!item, concat("New Input Row: ", reverse(enumerate(local!newRowCount))[local!totalRowIndex - fv!index + 1]+1) ) ),
The Error line is
a!dropdownField_20r2(
You should just need to post the contents of a!dropdownField_20r2(), including the choiceValues, value, and saveInto parameters (which you haven't included here). In this example everything prior to a!dropdownField is not really relevant.
It may also help to see the part of your code where local!totalRowList is first initialized. And since it looks like your choiceLabels code is doing something fairly convoluted, a brief explanation of what you're trying to accomplish over-all might help folks understand what's happening there.
As an aside, when inserting SAIL code like this, there is a handy feature here in Community called "Insert Code" ("Insert" --> "Insert Code") which will provide a text box you can paste code into, which will preserve important formatting such as indentation, along with preventing longer code from blowing out the comment length.
At the end of the day your posted code should look more like this:
a!dropdownField_20r2( label: "Field ID", placeholderLabel: "Please Select", choiceLabels: a!forEach( items: local!totalRowList, expression: if( fv!index < (local!totalRowIndex + 1 - local!newRowCount), fv!item, concat( "New Input Row: ", reverse(enumerate(local!newRowCount))[local!totalRowIndex - fv!index + 1]+1 ) ) ), choiceValues: /* ??? */ value: /* ??? */ saveInto: /* ??? */ )
a!dropdownField_20r2( label: "Field ID", placeholderLabel: "Please Select", choiceLabels: a!forEach( items: {local!totalRowList}, expression: if(fv!index < (local!totalRowIndex + 1 - local!newRowCount), fv!item, concat("New Input Row: ", reverse(enumerate(local!newRowCount))[local!totalRowIndex - fv!index + 1]+1) ) ), choiceValues: {local!dropdownValues}, value: if(rule!APN_isBlank(local!dropdownSelectedID), "", local!dropdownSelectedID ), saveInto: { local!dropdownSelectedID, if(local!dropdownSelectedID = "", a!save(local!dropdownSelectedID,local!totalRowList[1]), local!dropdownSelectedID ) }, required: true ) } ),
Well there's one overwhelming issue: your choiceLabels and choiceValues should be two corresponding, equal-length arrays. In general I recommend using the same CDT to set both; usually the technique would be to set "values" as the ID of a CDT, whereas "labels" is set to the human-readable value within the CDT.
I have no way yet to tell how you're declaring your local!totalRowList variable, but I'm guessing somewhere in your transformation here the type is getting messed up. Also, just in case, I would set your "value:" parameter to just local!dropdownSelectedID, there should be no need to do the null check there just to set it to a null value if it's null.