Jump to content

valueListItem syntax


This topic is 5752 days old. Please don't post here. Open a new topic instead.

Recommended Posts

ValueListItems returns a list of values. If you want to check that a field is equal to one of the values then you need to check that it is in the lis. For example

PatternCount(Afield;ValueListItems("student";"school location")) > 0

should normally work, but, if there is a possibility of Afield being actually within one of the values then you may have to add in some extra carriage returns to ensure that you are checking for a complete value:

PatternCount("¶" & Afield & "¶";"¶" & ValueListItems("student";"school location") & "¶")> 0

There may be simpler ways of doing this, if so it would be nice to see them.

Link to comment
Share on other sites

There could be some syntactical things wrong, I do always make the first parameter in the function a Get ( FileName ) instead of hardwirering.

Next thing that comes to mind is if the field the valuelist is basede on can't be indexed, will the valuelist be very very short :

But it surprises me that a school location only exists in a valuelist, is it a dynamic valuelist?? If so couldn't a multicriteria relation ship be used instead to establish a IsValid[

http://www.filemaker.com/help/FunctionsRef-311.html

...which is almost, if not quite the same as you "Help" throws up!

To me is VL's here a convoluted way of establishing a membership of a found set of records.

--sd

Link to comment
Share on other sites

well, I know the valulist is coming from another file not table. And it is just a list not from a field... however, I am going to change that and make a new table in the same file that allows the user to add a school location as a new record. Then I will base the valuelist off that field from that table. Let me set that up first and see if it functions better that way.

Link to comment
Share on other sites

Hi Himitsu

Many apologies for failing to see this earlier but I console myself with the thought that I am not the only one who missed it. The PatternCount function has it's parameters the wrong way round. In your sample use:

Exit loop If[

PatternCount (ValueListItems (Get ( FileName ) ; "school location" );valueListValidate::location_G

)]

Link to comment
Share on other sites

This topic is 5752 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.