I am new to FME. Although I can deduce how to use @value(Attribute) in a text editor in the workspace, I am not sure how the $ symbol is used and how it can be chained to say @value. Also are there other keywords with the @ symbol. Where in the documentation are all these symbols and their usage comprehensively defined and illustrated? Thanks.
Those two symbols are used to designate that whatever follows is either a function or a parameter.
@ is followed by the name of the function to call and a paranthesis with any parameters to the function. Considering the following function call:
@Value(my_attribute)
This means that we're calling the function "Value" with "my_attribute" as a parameter. The "Value" function returns the value of the feature attribute specified as a parameter.
You can find a partial list of all the FME functions here (all those starting with @):
https://docs.safe.com/fme/html/FME_FactFunc/index.html
$ is a macro that resolves a published or private parameter, usually specified like this:
$(my_published_parameter)
This will return the value of the private or published parameter called "my_published_parameter". This mimicks the functionality found in the ParameterFetcher transformer.
Hopefully someone from Safe can point to the relevant chapters in the documentation where this is described in more detail.
Thank you. I searched quite a bit in the FME docs but could not find any direct discussion of this.
Hi @mkumbale,
I apologize that it was not easy to find the information on the usage of these symbols. @david_r has explained the definitions of the 2 symbols quite nicely.
Some further information:
- Documentation about some of the functions available with the @ symbol:
- Documentation about the macros which can be accessed with the $ symbol- FME Parameters
- FME Server Parameters
- Any other User Parameters can also be accessed with the $ symbol followed by it’s name
There is also a blog post on using User Parameters and Attribute Assignments? It discusses Attribute Assignment and user parameters, with a section on how you can use both an FME function (@) and a parameter ($) together.
For something a little more advanced - If you are looking for what other macros are available in your workspace, this comment here has a Python code that you could use in a PythonCaller. It logs the macros for the workspace as warnings in the log file so it is easier to identify. Just be sure you “import fme import fmeobjects” at the beginning too.
Happy FME’ing!
-Andrea
Hi @mkumbale,
I apologize that it was not easy to find the information on the usage of these symbols. @david_r has explained the definitions of the 2 symbols quite nicely.
Some further information:
- Documentation about some of the functions available with the @ symbol:
- Documentation about the macros which can be accessed with the $ symbol- FME Parameters
- FME Server Parameters
- Any other User Parameters can also be accessed with the $ symbol followed by it’s name
There is also a blog post on using User Parameters and Attribute Assignments? It discusses Attribute Assignment and user parameters, with a section on how you can use both an FME function (@) and a parameter ($) together.
For something a little more advanced - If you are looking for what other macros are available in your workspace, this comment here has a Python code that you could use in a PythonCaller. It logs the macros for the workspace as warnings in the log file so it is easier to identify. Just be sure you “import fme import fmeobjects” at the beginning too.
Happy FME’ing!
-Andrea
Those two symbols are used to designate that whatever follows is either a function or a parameter.
@ is followed by the name of the function to call and a paranthesis with any parameters to the function. Considering the following function call:
@Value(my_attribute)
This means that we're calling the function "Value" with "my_attribute" as a parameter. The "Value" function returns the value of the feature attribute specified as a parameter.
You can find a partial list of all the FME functions here (all those starting with @):
https://docs.safe.com/fme/html/FME_FactFunc/index.html
$ is a macro that resolves a published or private parameter, usually specified like this:
$(my_published_parameter)
This will return the value of the private or published parameter called "my_published_parameter". This mimicks the functionality found in the ParameterFetcher transformer.
Hopefully someone from Safe can point to the relevant chapters in the documentation where this is described in more detail.