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.

Inserting "*S" into a find request via a script - keeping the "s

Featured Replies

Hi All,

 

Probably a no go - but what I want to do is insert "*S" into a find request via a script - but keep the "s. So all of this →"*S"← is input via the script. Of course, when I script it: Set Field ""*S"" then it thinks it's inputing "" & *S & "" which doesn't work. Is there a way to do this?

Thanks for any tips

I have read this several times and I am still not sure I understand it.

If (as my best guess leads me to believe) you want to set a field to some text that includes quotes, e.g.

"*S"

you must escape the literal quotes in the calculation that returns the text:

"\"*S\""

 

Alternatively, in your example you could also use:

Quote ( "*S" )

but you must be careful with this method because the Quote() function does more than just add quotes.

 

Your title mentions "inserting". Setting a field using the Set Field script step is not "inserting". If you like, you can use the Insert Text step instead. Here you can specify the text directly, with no need for escaping. However, there are other limitations that apply.

 

All of this has nothing to do with find requests. The rules for setting a field are the same regardless of the current mode.

 

1 hour ago, Slater said:

Of course, when I script it: Set Field ""*S"" then it thinks it's inputing "" & *S & "" 

I don't think so. If you try to set a field to: 

""*S""

you will get an error and you won't be able to close the calculation window.

 

Edited by comment

  • Author

Thank you Comment for replying to me. And apologies for not being more clear.

I have the need to perform a find on a set of records. The string that I want to search for is *S. I want to do this via a script.

So I was running into problems when I was using Set Field within the script, because as you say 

Quote

you will get an error and you won't be able to close the calculation window.

But your suggestion to use 

Quote

"\"*S\""

within the Set Field works perfectly, and means that I get the whole of the string that I want to be used within the Find! Thank you very much for that little piece of magic :)

15 minutes ago, Slater said:

The string that I want to search for is *S

Wouldn't it be sufficient to set the searched field to:

\*S

?

  • Author

How I've now got it set up works perfectly, thank you.

Can you tell me how it works, I can't readily see how Set Field  "\"*S\"" actually inputs "*S" into the field.

 

Quote

Wouldn't it be sufficient to set the searched field to: \*S

As per the above, I don't know the syntax of what it's doing. I tried this but Set Field wouldn't take it. Thanks thoughScript.jpg.267fc2d707d68accce9cea643297b79e.jpg

24 minutes ago, Slater said:

Can you tell me how it works

See the explanation here (esp. the 6th item in Notes).

 

24 minutes ago, Slater said:

I tried this but Set Field wouldn't take it.

See the attached.

Find*S.fmp12

Edited by comment

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.