AnsweredAssumed Answered

Performing Find on field with URLs containing @, *, # etc

Question asked by phil66 on Apr 24, 2018
Latest reply on Apr 25, 2018 by user19752

I have created a FMP14 database where users can store and share experiences about websites that they have found useful.  It relies on establishing that the URL is unique and not already entered in a table so that users don’t create a new record when one already exits .  I have used a perform find in the script that searches for matches .   This works well for simple URLs that don’t contain special characters FMP uses in perform find searches (@, *, #, ?, !, =, <, >, " )

but it doesn’t seem recognise identical URLs that contain these characters.  I understand that there are special characters that can be inserted that jump individual special characters that come after it but there is no way that I can predict where these characters are going to appear in a URL string that generated by query based websites.

 

I want a way that I can bypass all special characters and treat it a literal text string.

 

here's a bit of the script I am working on.  I hope you can see my problem

 

 

Set Variable [ $url; Value:person::URL_enter ]

Set Variable [ $object_title; Value:person::title_enter ]
Set Field [ person::URL_enter; "" ]
Set Field [ person::title_enter; "" ]
Go to Layout [ “object” (object) ]
Show All Records
Enter Find Mode [ ]
Set Field [ object::URL;$url ]
Set Error Capture [ On ]
Perform Find [ ]
Set Variable [ $last_error; Value:Get ( LastError ) ]
If [ $last_error > 0 ]

#record not found;create new one

Show Custom Dialog [ Title: "Record not found (level 1)"; Message: "do you wish to create one...?"; Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No” ] New Record/Request
// Commit Records/Requests
Set Variable
[ $objectK; Value:object::__objectPK ]

Set Field [ object::title; $object_title ]
Set Field [ object::created_date; Get ( CurrentDate ) ]

Set Field [ object::URL; $url ]

 

...

Outcomes