Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

This is a long desciption, hope I am not pushing the system, here goes...

I have a text field that gets populated with "items" - text that are delimited (in the field) with comma and a space (due to screen space issues). As these items build up for each record, I then want to press a button to look at the related records for this field and take all the items, make them into a check box list so that previous items across all the related records can be selected, then take these selected items back to the original field delimited as above.

I have done this using a self relationship, replacing the comma and space with a return then displaying this field as checkbox field ( in a seperate file using set field and substitute functions....then reverse to take it back into the original field and file. This works like a charm except.......

As this self relationship uses the indexing capabilities of FMP I occassionally run into the 20 / 60 limitation when two items start with the same characters. This causes the current set of items to be lost during the set field step after the first similar item. So...

Can I still enter items as continuous delimited text in a field, then via button / script go to another file put in the new (or maybe replecated) items into separate records removing duplicates then say using a scripted check box container select records and then send the selected ones back to the original field, comma delimited. The second file should contain all the items across the records in the first file but no duplicates that are there the items fields

Hope that makes sense, can anyone understand it and help with the scipting

Thanks very much

Tony

Posted

I'm not sure if I've understood the problem, however let me try.

So (my interpretation , could be wrong) the "item" you enter in the text field is "more-than-one-word" item, hence from time to time it's entire/partial size is larger than 60/20 chars, right?

If so,than you'll have to find those items (loop inside the script that format the field substituting coma space with return) flag them in some way after saving original value temporary in some global field, do necessary resizing (remove (extra chars+1)or more than suffix it with incrementing "counter")

Activate the rel, put saved value in the record (create aux fields if necessary with some flagging scheme)

I don't now if I should post this answer confused.gif

The rest of your post is how to say confused.gifconfused.gif

So maybe you should try to restate it. also if you send me those file I'd have much clearer picture on what is happening really there.

Dj crazy.gif

Posted

Thanks for your reply, sorry for my delay, I sped some time away from my machine.

You have understood most of the problem. I will need to make a couple of small files to illustrate the problem rather than sending the exisiting solution. Please bear with me.

Thanks in advance

Tony

Posted

Hello again

I have made up two small files (zipped) to illustrate the problem as you requested.

If you have any ides how I might achieve the solution I am after I would very much appreciate it.

Thanks very much

Tony

Twofiles.zip

Posted

Hi Guys

I guess I have not explained myself well enough. Here's a simple version.

I have a text field with items of more than one word seperated by comma and a space eg

"a green apple, a red car with black wheels, a quick brown fox" etc

This field has many items in different records having the same or different items

I would like to make a scipt to export this field from the current record to another file so that each item becomes a record in this other file. The script would need to check for duplicates and eliminate them.

The second script would select records (using check box flag etc) from this file and send them back to the first file and put into the field as comma space separted.

I hope this explains the message or is this too complex to do via forums

Any comments would be appreciated

Thanks

Tony

  • 2 weeks later...
Posted

OK, I was absent but now here's what I came with.

(look at attachment)

I've created an third file name list.fp5 but basically it the same file you already have.

check script "create records" for the first part of task you've asked for and addCauses and removeCauses for the second part.

HTH

Dj

textmanipulation.zip

Posted

Hello DJ

Thanks very much for replying. I was trying to get there on my own but nested functions more than two deep are hard to constructand diagnose for me at this time particularly when it needs

Substitute(gTemp, Substitute(MiddleWords(Substitute(ValueListItems(Status(CurrentFileName), "relList"), " ", "-"), gCounter, 1) , "-", " ") & "

  • 2 weeks later...
Posted

Hello Dj

Thanks again, with the help of yourself and a solution I found on the afilemakeraffliction.com site (converting fields to seperate records in another file) I am well on the way to doing this. Next is to find duplicates and delete from related file (standard technique in this case). I will post file(s) when complete. Others may find it useful

Asalways in FMP there is more than one way to skin the cat

Thanks again very much

Tony smile.gif

This topic is 8140 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.