How to set the attribute name to published/private parameter value in FME 2019.1 ? Is it possible to do ?
Original post here:
https://knowledge.safe.com/questions/2329/renaming-an-attribute-name-to-a-parameter-value.html
How to set the attribute name to published/private parameter value in FME 2019.1 ? Is it possible to do ?
Original post here:
https://knowledge.safe.com/questions/2329/renaming-an-attribute-name-to-a-parameter-value.html
Hi @fikusas, you have achieved that already with the setting shown in your screenshot.
Just be aware FME Workbench cannot automatically expose the attribute name created with such a way. You can see the attribute in the Log if you connect a Logger to the AttributeCreator and run the workspace.
Hi @fikusas, you have achieved that already with the setting shown in your screenshot.
Just be aware FME Workbench cannot automatically expose the attribute name created with such a way. You can see the attribute in the Log if you connect a Logger to the AttributeCreator and run the workspace.
How can I expose this attribute then? It doesn't work in my example below, 'cause it's showing parameter name, not parameter value.
Hi @fikusas, you have achieved that already with the setting shown in your screenshot.
Just be aware FME Workbench cannot automatically expose the attribute name created with such a way. You can see the attribute in the Log if you connect a Logger to the AttributeCreator and run the workspace.
FME Workbench can only expose attribute names statically determined when creating the workspace. Since a parameter value or an attribute value will be determined at run-time, FME Workbench cannot expose attribute names that will be derived from their values , unfortunately.
FME Workbench can only expose attribute names statically determined when creating the workspace. Since a parameter value or an attribute value will be determined at run-time, FME Workbench cannot expose attribute names that will be derived from their values , unfortunately.
Maybe it can be done via Python script? Unfortunately, I'm an absolute novice in Python...
This is a fairly frequent question, have a look at these two previous replies and see if helps:
https://knowledge.safe.com/questions/32483/dynamic-attributes-in-custom-transformer.html
https://knowledge.safe.com/questions/32777/how-to-expose-all-attributes-in-generic-way-any-ma.html
FME Workbench can only expose attribute names statically determined when creating the workspace. Since a parameter value or an attribute value will be determined at run-time, FME Workbench cannot expose attribute names that will be derived from their values , unfortunately.
No, there is no way to automatically expose attribute names that could be changed at run-time even if you use Python script, at least in the current version of FME Desktop.
Why do you need to expose the new attribute name given as a parameter value? Depending on the purpose, there could be a workaround without exposing the name.
No, there is no way to automatically expose attribute names that could be changed at run-time even if you use Python script, at least in the current version of FME Desktop.
Why do you need to expose the new attribute name given as a parameter value? Depending on the purpose, there could be a workaround without exposing the name.
I need to re-run the model on monthly basis and the attribute name must differ every month. For example, in November it should be named "Example201911", in December – "Example201912" and so on.
I need to re-run the model on monthly basis and the attribute name must differ every month. For example, in November it should be named "Example201911", in December – "Example201912" and so on.
No, it's not possible to write output dinamically, 'cause the final structure is determined in the workspace itself.
No, there is no way to automatically expose attribute names that could be changed at run-time even if you use Python script, at least in the current version of FME Desktop.
Why do you need to expose the new attribute name given as a parameter value? Depending on the purpose, there could be a workaround without exposing the name.
Well, then why you need to expose the attribute name? That's the point of my question.
Well, then why you need to expose the attribute name? That's the point of my question.
I thought what FME can take attribute name from parameter, but doesn't expose it. But if it can't take name from paramater, exposing isn't helping either.
Well, then why you need to expose the attribute name? That's the point of my question.
FME can take attribute name from a parameter at run-time. Exposing attribute names is not always essential. Depending on how you intend to use the attribute in the workspace, you could configure the workspace appropriately even if the attribute name wasn't exposed. I therefore would like to know why you think it's need to expose the attribute name.
FME can take attribute name from a parameter at run-time. Exposing attribute names is not always essential. Depending on how you intend to use the attribute in the workspace, you could configure the workspace appropriately even if the attribute name wasn't exposed. I therefore would like to know why you think it's need to expose the attribute name.
As I wrote earlier:
I need to re-run the model on monthly basis and the attribute name must differ every month. For example, in November it should be named "Example201911", in December – "Example201912" and so on.
This attribute is created via AttributeCreator. So it's name must be typed manually every month. I thought it can be done via fetching attribute name from parameter value, but in practise it doesn't work.
As you can see in this screenshot, the attribute with your desired name can be definitely created.
Then, how do you need to use the attribute in the subsequent process? Depending on how you intend to use it, exposing its name might not be essential.
As you can see in this screenshot, the attribute with your desired name can be definitely created.
Then, how do you need to use the attribute in the subsequent process? Depending on how you intend to use it, exposing its name might not be essential.
I need to pass other attribute values to this one.
As you can see in this screenshot, the attribute with your desired name can be definitely created.
Then, how do you need to use the attribute in the subsequent process? Depending on how you intend to use it, exposing its name might not be essential.
You can do this. And then?
You can do this. And then?
And then it doesn't work. Attribute name becomes "attributeNR1", not the actual value of the parameter NAME (in this case "Example201911").
And then it doesn't work. Attribute name becomes "attributeNR1", not the actual value of the parameter NAME (in this case "Example201911").
You cannot use the visual preview table in FME for dynamic attributes, as the preview shows the static schema based on your workspace design, not the dynamic schema.
There are two options:
As you can see, the result is an attribute called "Example201911" with the value "<strong>some value</strong>"
You cannot use the visual preview table in FME for dynamic attributes, as the preview shows the static schema based on your workspace design, not the dynamic schema.
There are two options:
As you can see, the result is an attribute called "Example201911" with the value "<strong>some value</strong>"
You need to use a dynamic writer with a user-defined schema feature, it's described in a fair amount of detail here: https://knowledge.safe.com/articles/1051/index.html
Welcome to the not-always-wonderful world of dynamic schemas...
You need to use a dynamic writer with a user-defined schema feature, it's described in a fair amount of detail here: https://knowledge.safe.com/articles/1051/index.html
Welcome to the not-always-wonderful world of dynamic schemas...
Hmm, it's not as simple solution that I expected, but need to look up on how to set up those dynamic schemas. Thanks!
Hmm, it's not as simple solution that I expected, but need to look up on how to set up those dynamic schemas. Thanks!
Here's a couple of tips to make it easier for you: