FileMaker does not have a native star, rating, or favorites control similar to common apps we see like iTunes for rating favorite songs. It’s a simple way to select your favorite and see it displayed visually.
After a Google search I was unable to find any simple or up-to-date solutions for this type control. Some attempts had been made long ago but they were overly complex with the features that exist in the latest versions of FileMaker.
It’s possible to create one using the Button Bar that has many desirable characteristics:
- It’s one object that can be copied and pasted easily into another solution.
- The object automatically displays the star rating using conditional formatting.
- It’s easy to restyle for different colors.
- No special fonts, graphics, or container fields are required.
- It works across platforms with native star images that already exist in FileMaker.
- The rating value is stored in one simple number field that contains a number from 1-5.
- No calculation fields or scripts are required.
- The stars can be set to zero or none by toggling the first star.
- Lists can be sorted by the Rating field.
- Each star has 1 script step that sets the Rating field to a number 1-5. The script on the first star toggles the Rating field between 1 and blank.
Here’s a little detail on how it was built.
First, we created the Rating field as a Number. Then we created a Button Bar with 5 segments.
We set each button in the button bar to the built-in star icon at 24 pt size. Then we formatted the button bar so there were no lines or dividers. We set one script step attached to each icon sets the value of the Rating field to blank/1, 2, 3, 4, or 5. We set the main color of the In Focus icons to grey.
Then we selected each star icon and set conditional formatting to turn the icon red depending on the value of the Ratings field.
That’s it. The control can be easily copied and pasted into your solution if the Table name matches (can be changed in the sample file) and the connected numeric field named “Rating” exists in your table.
Download the free example file here so you can incorporate it into your own FileMaker solutions. Enjoy!
Also published on Medium.