Skip 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.

Import file to field using script parameters

Featured Replies

Hi All,

I have records that each have several files that I am inserting into container fields. I would like to know if there is a way to use one script and have the field being imported to detirmined by a script parameter carrying the field name?

Thanks

I think you've stumbled on the fact that you can't use the 'Set Field By Name' script step to enter data into container fields. I'm not sure why this is, since you can use the 'Set Field' step for this purpose. Therefore I think you'll need to do it the old fashioned way...

Have your script import the file into a global container. Then run a loop containing the 'Go to Next Field' and 'Exit Loop If [ Get ( ActiveFieldName ) = Get (ScriptParameter) ]'. Bracket the loop with 'Freeze Window' and 'Refresh Window' so the user doesn't have to watch the cursor jumping through the fields. Then use the 'Set Field' step specifying tempContainer as the calulated result.

Edited by Guest

you can't use the 'Set Field By Name' script step to enter data into container fields.

What leads to you this conclusion?

Can you clarify what exactly do you want to accomplish? First you say "insert", then you say "import" - these are NOT the same.

  • Author

Sorry for the confusion comment. I am looking to insert a file or picture into a container field. I currently have a button set up for each field and was about to script each one seperately with goto field and inset file / picture. But then I thought it would be nice to have one script that will insert into any field according to a script parameter. I was also thinking I could specify file or picture by combining field - type in the parameter and parsing it out.

Well, if it always were a picture, you could do:

If [ Get (ScriptParameter) = 1 ]

Go to Field [ Table::Container 1 ]

Else If [ Get (ScriptParameter) = 2 ]

Go to Field [ Table::Container 2 ]

Else

Go to Field [ Table::Container 3 ]

End If

Insert Picture []

or, if you name the field objects:

Go to Object [ Get (ScriptParameter) ]

Insert Picture []

But I don't see how you're going to make the call between picture and file - will there be a separate button for each?

  • Author

Thanks comment. I was able to put it together using the object idea. So here is my solution using a script parameter formated as "Object - Type".

Go to Object [ Object Name: LeftWords ( Get ( ScriptParameter ) ; 1 ) ]

If [ RightWords ( Get ( ScriptParameter ) ; 1 ) = "Picture" ]

Insert Picture [ ]

Else If [ RightWords ( Get ( ScriptParameter ) ; 1 ) = "File" ]

Insert File [ ]

End If

It's working great!

Thanks again

What leads you to this conclusion.

I tried it.

The 'Set Field' script transfers the contents of a container item from one field to another but the 'Set Field By Name' script does not.

Does it work for you?

Oh, you're right. Thanks for straightening me out. I was leaving out the quote marks in the target calculation. :

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.