Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Script to search found set not returning properly

Featured Replies

I have a script that searches the "set" field, that works properly. The script is this:

Show Custom Dialog ["Search Cards"; "Input the search criteria you want!"; Magic::Quickfind]
Perform Quick Find [Magic::Quickfind]
Set Field[Magic::Quickfind]

If I put in a name of a deck it finds every card in the deck. Then I have another button after I am in the found set to search by color. This is were the problem lies. It will take the color that is already showing on the record in view and use that and it will work. But if I put another color in, it starts showing me all the records that I have in the entire database. I have 23,106 records so many times the count gives me up to 12,000. I am not sure how to constrain the search. Here is the code:

Show Custom Dialog ["Color"; "Search by Color."; Magic::Color]
Perform Quick Find [Magic::Color]
Set Field [Magic::Quickfind]

Quickfind is a Global Text field.

there is a constrain found set script step that you can use. (instead of perform find)

M

  • Author

Thank you I tried that. Here is what I put:

Show Custom Dialog["Color", "Search by Color."; Magic::Color]
Constrain Found Set [Restore]
Set Field [Magic::Color]

It still tries to find the color that is already showing on the screen for that current record. If I type a color in I get this error:

 

"The provided find criteria is not valid. Enter a valid request before proceeding."

The set field statement doesn't do anything.

 

A set field statement takes two properties; which field are you setting; what value are you setting?

 

It is like saying "set this field to this value"

 

But you aren't doing that you're only saying "set this field"

 

FileMaker is left wondering.

Set this field to what?

  • Author

That is a problem. I don't want to set a field. I want to be able to do another find after I am in a found set. But when I get in the found set and click my button to search for a color it takes the color that is already there and put it in the search bar. If I put a color in the serach box it replaces what was there.

If you don't want to set a field then why are you setting a field?

 

Why is the script step even there?

 

But - if you are trying to perform a find - you MUST set a field.

 

FileMaker has to know what field you are searching; for what value.

Show Custom Dialog ["Search Cards"; "Input the search criteria you want!"; Magic::Quickfind]
If[ get(lastmessageChoice) = 1]

Enter Find Mode

Set Field [Magic::Color; Magic::Quickfind]

Constrain Found Set []

End IF

  • Author

Ok, I am still missing something. The find is not working. When I go in a search for a set like "Dragon's Maze" I get that. But then I want to search colors in the set of Dragon's Maze and it does not give me that. It wants me to modify and when I do it gives me all the cards that color. I am attaching an example of what the database looks like.

Magic_FMForum.zip

But the database does not have the script installed.

 

And it doesn't have the quickfind field.

 

And all the scripts are full of errors and references to fields that don't exist.

  • Author

Sorry. Here is the updated one. I had to delete 24,000 records first. There are 5 records in there. I would like to be able to search any field after a set is found. This example shows Dragon's Maze as the set. The C is for color is the main one I would like to be able to search by after a set is found. Thank you.

Magic_REVA_FORUM.zip

The script is posted above. (message #7)

 

Set up the file with THAT script.

 

If it still doesn't work, post the file; with that script installed.

Here is your file with a constrain on color. The script above was correct. However you needed to specify the color field for a constrain. Not the quickfind field, which is how I think you tried it. You will find a new script and button on your layout. 

Magic_REVA_FORUM Fixed.zip

  • Author

Ok, I did as requested. Here is what it is doing. I added a 6th record called Ravnica. I click on Search Cards and type in Dragon's Maze. I get no records match this find criteria and record six now shows Dragon's Maze in the color slot instead of the Color slot. If I click on continue I get 0/6 Found (unsorted). If I modify the find and put in "R" for the color it gives me the 1 card that has red in it, so that part looks like it works. Here is the program again with the updated script. I put it on the button "SEARCH CARDS". Thank you.

Magic_REVA_FORUM Copy.zip

Your request was to do a constrained search on color after a different find operation was used to find a card set.

 

Why did you attach the color search script steps to the card search script?

 

Also: did you look at the two example files posted above?

  • Author

I apologize. I did not download your last update. Everything is working great now. Sorry I know I wasted your time at the end. Thank you very much for your patience and guidance.

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.