mcbain2279 Posted April 26, 2004 Posted April 26, 2004 First time posting but long time user. I am looking to do multiple substitutions in fmp 7. I was told that it could be done but I have been unable to get it to run. My script is: Go to Record/Request/page[First] loop Set Field[completed_template; Substitute(template; "the_item_name"; item_name)] Set Field[completed_template; Substitute(template; "the_item_id"; item_id)] Set Field[completed_template; Substitute(template; "the_item_case"; item_case)] Go to Record/Request/Page[Next; Exit after last] end loop item_name, item_id, item_case, completed_template are all text fields template is text global The script runs but only substitutes every occurace of "the_item_name" for item_name in the global field and does not substitute either of the two other substitution fields. Can anyone see what the problem is? Where am I going wrong? Thanks
The Shadow Posted April 26, 2004 Posted April 26, 2004 To get your script working, you need to reuse the value you modified: Go to Record/Request/page[First] loop Set Field[completed_template; Substitute(template; "the_item_name"; item_name)] Set Field[completed_template; Substitute(completed_template; "the_item_id"; item_id)] Set Field[completed_template; Substitute(completed_template; "the_item_case"; item_case)] Go to Record/Request/Page[Next; Exit after last] end loop To use the new FM7 multi-substitute feature, your script would be changed to: Go to Record/Request/page[First] loop Set Field[completed_template; Substitute(template; ["the_item_name"; item_name]; ["the_item_id"; item_id]; ["the_item_case"; item_case] )] Go to Record/Request/Page[Next; Exit after last] end loop
mcbain2279 Posted April 26, 2004 Author Posted April 26, 2004 The shadow does know that was a great help. Thank you very much.
Recommended Posts
This topic is 7883 days old. Please don't post here. Open a new topic instead.
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 accountSign in
Already have an account? Sign in here.
Sign In Now