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.

Adding multiple records to one table upon creating a new record on another table

Featured Replies

  • Newbies

Hi everyone good afternoon!!

I’m dueling with FileMaker trying to make the following:

I have 3 tables (this is for a game I’m developing):

Player (id, name)

PlayerStats (id, playerId, statId, value)

Stats (id, name)

The Player relates to PlayerStats with one to many. The Stats doesn’t relate to anything as I’m using it more like a list source for the “statId” field (or should I make a relation there?)

my question is how can I make it so that when I add a new player record it automatically creates all the PlayerStats entries (on for each entry in the Stats table for that Player) and when deleting a record from Stats table all the PlayerStats that refer to that Stat get removed also.

 

also I don’t know if this is the right forum to post this... but I don’t know where it should go... and I also don’t know if this was asked before as I don’t know what to search for in order to do this. :/ 😐 

Edited by xykudyax

You will have to script record creation. You can either place a portal on the layout and go to that object or you can go to the native layout and create a records there.

I recommend learning about ERDs. You can use Google, there are tons of examples out there.

Here's a demo. However, there is no check to see if there already is a record with the stat for this player (that is, no check for duplicates). Also, what happens if you add a stat? You'd need a script to add that stat to the players_stats table for each player.

xydudyax.fmp12

  • Author
  • Newbies

Thank you so much for your help ;) I'll give it a look!

13 hours ago, bcooney said:

Also, what happens if you add a stat? You'd need a script to add that stat to the players_stats table for each player.

 

That's exactly that!! It will need to be added automatically to every player_stats of each player!

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.