Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Specify field name in calc using variable

Five Fingers

Recommended Posts

Hello All,


I was wondering if it's possible to specify a field name within a calculation using a variable, e.g. -


Set Variable [$Word; "dog"]

Set Field [ Hot & $Word ; "Breed" ]


So that the field named "Hotdog" results in the word "Breed".


Does this make sense? My reason for this is that I have a large number of scripts that are only slightly different. I'd like to consolidate them into a single script.


Thanks for your help!


Link to comment
Share on other sites

In a word, No. The target field for a Set Field script step cannot be specified by calculation. But it would be a good feature request. ;)

Link to comment
Share on other sites

Thanks, David Head. That would explain why my early attempts failed and then I couldn't find any reference online about how to be able to do anything like this. Where would you suggest I make a feature request? Obviously, it won't help me with this solution, but I'd like to contribute to the FM community.



Link to comment
Share on other sites

You can still consolidate a lot of scripts, though, by using


If [ variable x = "foo" ]

Set Field [ foo ; "bar" ]

Else If [ variable x = "moon" ]

Set Field [ moon ; "shine" ]


End If


Use comments liberally to help you steer through these scripts, though.

Link to comment
Share on other sites

You're far far far from alone in wanting this. FileMaker has a "feature request" screen somewhere on their web page, but such a request would not be unique or first in the queue of such. I've been begging for it since FileMaker 5.5 was the flagship product. That's when they introduced GetField() but you can only use GetField () on the "right hand side", for instance the calculation that you set a field to, and not providing a similar indirect reference for the left hand side seemed an omission of major proportions. Still does.

Link to comment
Share on other sites

This thread is quite old. Please start a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

Terms of Use