Jump to content

Perform Find - Edit Find Request: Is there a way to pass a parameter and use as a variable for the "FIELD" in Edit Find Request?


Recommended Posts

Posted

Hi all,

I have a script that I would like to use in multiple "similar" situations.

To do this, I need to pass a parameter to set a variable for it to FIND a record in the PERFORM FIND script step - specifically in the EDIT FIND REQUEST dialog (see screenshot attached).

Any help is appreciated, thanks.

edit_find_request.png

Posted (edited)

You cannot use a variable to specify the field in the Edit Find Request window.

But a find request can also be constructed through setting fields -  and then you can use the script parameter to select which field to use, similar to what we discussed only recently here:
https://fmforums.com/topic/110860-script-problem-remove-container-file-from-a-record-trying-to-transition-to-json-to-pass-multiple-parameters/#findComment-494081

 

Edited by comment
  • Thanks 1
Posted

Just to comment on this line of thinking: “I have a script that I would like to use in multiple "similar" situations”. Be aware that what seems economical can lead to highly conditional scripts that are difficult to maintain or change without risk. Separate scripts without much indirection or abstraction are more easy to maintain and troubleshoot. Consider the trade off you’re making. 

  • Thanks 1
  • 2 weeks later...
Posted (edited)
On 7/13/2025 at 9:38 PM, comment said:

But a find request can also be constructed through setting fields -  and then you can use the script parameter to select which field to use, similar to what we discussed only recently here:
https://fmforums.com/topic/110860-script-problem-remove-container-file-from-a-record-trying-to-transition-to-json-to-pass-multiple-parameters/#findComment-494081

Hi Comment,

I appreciate your help once again!

Apologies for my absence in replying (I got pneumonia and finally getting back to things). 

It took me a while to figure out what you, ultimately, clearly explained! I did get this to work. The trick for me was to use the "Enter Find Mode" script step instead of just the "Perform Find" to get my variables to be utilized. I believe I implemented this correctly...?

Using "GetFieldName" function in a similar way as you prescribed in the link you referenced helped me understand the need to - at times - get either one of these two parameters. I certainly suffer from "can't see the forest for the trees" and trying to improve.

I have attached two screenshots:

  1. The parameters I passed to script
  2. Script steps I used

Thank you!

parameters_passed.png

save_as_pdf_script_step.png

 

 

 

On 7/14/2025 at 4:44 AM, bcooney said:

Be aware that what seems economical can lead to highly conditional scripts that are difficult to maintain or change without risk. Separate scripts without much indirection or abstraction are more easy to maintain and troubleshoot. Consider the trade off you’re making. 

Hi Barbara,

I appreciate your insight: I am starting to see these "trade-offs" you speak of. I have learned how to use sub-scripts to help in this area, and I'm learning branching. It's an interesting "dichotomy" if you will: making scripts handle multiple situations (branching) is somewhat akin to "rolling-things-up; and sub-scripts are like boiling things down into discreet elements. 

I have actually spent probably 6 weeks on the scripts for my "function bar" and find myself going back and forth. There certainly is both art and science to this - and my minimal experience in scripting certainly makes it more challenging! 

Edited by dmontano
legibility

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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