Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

I am working on a database where I have two related tables

The main table contains my records which may have a number of variant names held in the related table

e.g. Record1 with related values Variant_name3 / Variant_name1 / Variant_name2.

Not all main records have variant names. Some records will have only one variant, while others have multiple related names (as above).

I want to concatenate the related record strings into a single text string held with Record1 which would read “Variant_name1, Variant_name2, Variant_name3”

I’d like them in alphabetical order with commas behind each string (but not the last one).

I’m not sure where to start apart from thinking about a loop through related records but how do I sort them alphabetically and test to see if I have more than one record – any pointers would be much appreciated

Thanks

David

Posted

Try a calculation field (result is Text) =

Substitute ( List ( Variants::Variant_name ) ; ¶ ; ", " )

Set the relationship to sort the related records by Variant_name.

Posted

I was going to chime in here but comment beat me to it. An alternative to using LIst is to declare a VALUE LIST based on the relationship.

You can use the ValueListItems function (in Design Functions) to provide a return delimited list that is ALREADY SORTED because value list are always sorted.

  • Newbies
Posted (edited)

Have a very similar problem to the OP.

In my case the text field with concatenated values needs to have some tags as delimiters instead of commas (xml), is it possible?

(I can start a new thread in case, don't want to hijack!)

Edited by Guest
Posted

And it would also work in FM7 - comment, surely you're not still on FM7?

Posted

Thanks Comment,

I have amnaged to get the Substitute method to work.

I can't understand what it's actually doing....could you explain what is happening .....I'm following blindly at present and want to learn how FM works!

Similarly I haven't managed to get the Value List to work - probably something I'm not doing

This forum is fantastic - thanks again (to all of you)

Posted

I can't understand what it's actually doing

Perhaps you should look at the result of just:

List ( Variants::Variant_name )

Then imagine substituting carriage returns with commas.

This topic is 5689 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
×
×
  • Create New...

Important Information

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