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.

Getting data to another table in another database

Featured Replies

  • Newbies

I have an accounts (income-expenses) table in a separate database. Can I script moving data via a $$variable into that outside table?

I see where I can Open File but it seems the script can't go to a layout outside its own database. I could hit the keys again and type the data into that outside table, but I'd love to script it.

You can call a script in the other file and pass it a parameter, using the Perform Script[] step.

Another option is to place tables from the other file on your relationships graph, create layouts for them and work with them directly.

  • Author
  • Newbies

Edit: Found it ! Get(scriptparameter). Thanks very much.

Thank you.

===================

I see that I can call a script from the other file.

I don't understand how to pass a parameter, but I see the option to enter one in the Perform Script box.

Can I first open and fill a variable with the number and use that to Set Field on the other side's table?

Or can I pass the field directly to the other layout and Set Field on the other side using data from that field?

  • Author
  • Newbies

Yes, thanks. I saw that I could, but because this is a rare occurrence, and no other need for that connection, I like passing the parameter and leaving them separate databases.

  • Author
  • Newbies

Now that I've learned to pass a parameter, I want to pass three :

It seems possible, but I can't figure out how to include MiddleValues() function with Get(scriptparameter) function.

I have three $$ variables on the 'here' side.

FMP seems to let me do this if I surround the three with quotes and place carriage returns in between.

Perform Script ["ascript" from file: "otherfile"; Parameter: "$$var1 (carr-return) $$var2 (carr-return) $$var3(carr-return)"

If this is right so far,

On the 'there' side, how do I parse the three into three separate Set Field statements ( Using MiddleValues() )?

You only need to use $$variables if you need them AFTER the script has run - otherwise it's better to use $variables that are cleared when the script exits.

Also, you do not need to declare variables only to populate the script parameter; you can calculate the script parameter directly.

Parameter: "$$var1 (carr-return) $$var2 (carr-return) $$var3(carr-return)"

If this is right so far

No. There should be no quotes, unless you are sending literal text.

You do need concatenation operators in-between the terms, though:

$$var1 & ¶ & $$var2 & ¶ & $$var3




To extract the n-th value on the target side, use:




GetValue ( Get (ScriptParameter) ; n )

  • Author
  • Newbies

Got it. Thanks for your help.

Create an account or sign in to comment

Important Information

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

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.