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.

Script problem: Remove container file from a record. Trying to transition to JSON to pass multiple parameters.

Featured Replies

Hi all,

I have spent all day stuck on this script. I am trying to "retrofit" this script by using JSON to pass multiple parameters into the script. I have attached two screenshots.

SCREENSHOT NAME: script_with_variable_not_working.png

This screenshot shows all script steps, PLUS, I commented in the beginning of the script the JSON I am using as Optional Script Parameters. This screenshot also shows an overlay of the dataviewer showing the incorrect results of the variable "$_container_field_name".

SCREENSHOT NAME: script_set_field_by_name_not_working.png

This screenshot shows line 16 throws the error message in red at the bottom: [102] Field is missing

I strongly suspect the problem lies is me trying to pass the field name of a CONTAINER type field using JSON. As a test, I tried switching to a TEXT type field and I was able to pass that as a variable.

GOAL:

  1. To remove a PICTURE or FILE from a container field, without deleting the record.
  2. To "parameterize" and use "variables" in this script so I can consolidate my scripts ( I need to stop making basically the same script over and over.)

APPROACH:

I wanted to pass two parameters using JSON so I can use:

  • one parameter for the FILENAME in the Custom Dialog presented to User when deleting the container data;
  • the second parameter to use as the field in which to use the Set Field script step to clear the content of the container.

Any help is appreciated, thanks.

 

script_with_variable_not_working.png

script_set_field_by_name_not_working.png

12 hours ago, dmontano said:

I strongly suspect the problem lies is me trying to pass the field name of a CONTAINER type field using JSON.

From what I can see the problem is that you are passing the container field's value instead of its name.

Try defining the script parameter along the lines of =

JSONSetElement ( "" ;
[ "container_field_name" ; GetFieldName ( document::document_file ) ; JSONString ] ;
[ "container_file_name" ; document::document_filename ; JSONString ]
)


You could also get by with:

JSONSetElement ( "" ;
[ "container_field_name" ; "document::document_file" ; JSONString ] ;
[ "container_file_name" ; document::document_filename ; JSONString ]
)

but this would break if you renamed the container field.

 

 

Edited by comment

  • Author
On 6/25/2025 at 12:38 AM, comment said:

Try defining the script parameter along the lines of =

JSONSetElement ( "" ;
[ "container_field_name" ; GetFieldName ( document::document_file ) ; JSONString ] ;
[ "container_file_name" ; document::document_filename ; JSONString ]
)

Hi Comment - this was exactly the solution.

I appreciate your time and effort - thank you.

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.