Jump to content
Sign in to follow this  

Export multiple related items from related table

Recommended Posts

I am having some trouble exporting the exact data I need from two tables (a one to many relationship). The main table has a record for each set number, and the related table has a record for each individual item number with a field that says what set number it is in and is related back to the main table. So it looks like this:

Main table:

SetID# (unique)


Related Table:

Item# (unique)

Set# (many, related to SetID#)

What I want to do is export (to an excel file, ultimately) The SetID#, SetTitle, and ALL the Item#s related to each set, with each Item# being in a separate field. But I can only get it to export the first related Item#, not all of them.

Is there some exporting strategy I am overlooking? Or maybe a way to set up a calculation that will take all the related Item#s and put them in a repeating field? (I already have a database structure that will use a calculation to take a repeating field and break it into individal fields, so I can use that tactic if I can get the data into a repeating field, but the manual says it will only lookup the first matching record.)

It is really frustrating because I have a portal in my main layout that lists all the item#s in that set, so I know there just has to be a way to do it. Maybe I could use a script?

Any help you can offer would be greatly appreciated. Thanks :)

Share this post

Link to post
Share on other sites

No, don't use repeating fields. Yes, use a script. With the Go to Related Record (GTRR) script step. It'd look something like:

If[ not IsEmpty( Items::Item# ) ]

Go to Related Record [ current record ; Items layout ]

Export Records [ restore ]

Go to Layout [ original layout ]

End If

The IF conditional checks whether there are any related Items records, and only does the GTRR and Export if there are.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...

Important Information

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