Hi, my co-workers and I have been battling this issue for two days and we are really getting nowhere fast.
We have a web form, which has four fields on it.
Each field contains a list of items with a relation with the other fields. So field1 Item 1, field2 Item 1, Field3 Item 1, and Field4 Item 1 are all related, Item 2 in each field is related to each other item 2 field item and so on down the list of items.
Fields:
Field1 is Part Number
Field2 is Description
Field3 is Max Quantity
Field4 is Unit (usually each)
We created a check box field from the description field and we would like to have the user select what items he wants by selecting them with a check box.
Once they select the items we would save the results in a seperate field.
Now we would like to get the original position number from the original list.
To do that we tried the following code in a Computed field
var:= @Text(SelectedlListField);
var1:= @Text(FullListField);
numlist := @Transform(var; “x”; @Member(var;var1));
numlist
When we try it we get a return of “0;0” if we select two items in the list instead of their position numbers. What are we missing or doing wrong?
Thanks for your help.
Dave
Subject: RE: Hi All… can you help?.. with lists in several fields
You have an @Transform loop with a loop variable of x, but you aren’t using x inside the loop.
Subject: RE: Hi All… can you help?.. with lists in several fields
Andre thank you so much for replying.
We tried your suggestion and we are still having the same problem. It returns zeros (0,0)
here is our new code in the computed field:
FIELD SelectedItems := SelectedItems;
FIELD FullList := FullList;
var:= SelectedItems;
var1:= FullList;
numlist := @Transform(var; “x”; @Member(x;var1));
numlist
Is there something wrong with our logic? We are just trying to return a position from one text field item from another text list field item.
Our SelectedItems text field looks like this:
Apple, Pear
our FullList text field looks like this:
Apple, Banana, Cherry, Guava, Pear
we would like a return of 1,5
Still not understanding what is going wrong here
thanks for the help.
Dave
Subject: RE: Hi All… can you help?.. with lists in several fields
There’s nothing wrong with your formula now (I tested it) except for being too verbose (you use too many temporary variables, and you don’t need any FIELD statements. If you need to refer to the value of a field, just use the field name).
So the problem must be that your fields don’t contain the data you expected. I suspect that FullList doesn’t really contain a list value, but a delimited string. Use a statement like the following to test it:
@Prompt([ok]; “FullList”; @Implode(@If(@Istext(FullList); “'” + FullList + “'”;@Text(FullList)); ", "));