Hi,
I know that you can set new attribute names and new attribute values using a list attributes as such:
attribute{0}.name
attribute{0}.fme_data_type
But how do I set the value of this new attribute?
Is it something like:
attribute{0}.value?
Thanks
Hi,
I know that you can set new attribute names and new attribute values using a list attributes as such:
attribute{0}.name
attribute{0}.fme_data_type
But how do I set the value of this new attribute?
Is it something like:
attribute{0}.value?
Thanks
You simply treat it as if it was any other attribute. In an AttributeManager:
Or in Python:
feature.setAttribute('attribute{0}.name', 'MyAttributeName')
feature.setAttribute('attribute{0}.fme_data_type', 'fme_varchar(64)')
feature.setAttribute('MyAttributeName', 'MyAttributeValue')
Here's a sample workspace (FME 2017) that I hope makes it clearer. Output looks like:
Here's a sample workspace (FME 2017) that I hope makes it clearer. Output looks like:
dynamic-excel-with-schema-feature.fmw (FME 2017.1)
I think the part you need is how to dynamically create attribute names. I would use 2 AttributeCreators. The first to create the attribute name, the second to create an attribute with this name.
00-create-schema-feature2017.fmw
dynamic-excel-with-schema-feature.fmw (FME 2017.1)
I think the part you need is how to dynamically create attribute names. I would use 2 AttributeCreators. The first to create the attribute name, the second to create an attribute with this name.
You simply treat it as if it was any other attribute. In an AttributeManager:
Or in Python:
feature.setAttribute('attribute{0}.name', 'MyAttributeName')
feature.setAttribute('attribute{0}.fme_data_type', 'fme_varchar(64)')
feature.setAttribute('MyAttributeName', 'MyAttributeValue')
Feel free to vote for this idea to improve the experience: https://knowledge.safe.com/idea/19730/introduce-new-transformer-to-modify-schema-easily.html
Feel free to vote for this idea to improve the experience: https://knowledge.safe.com/idea/19730/introduce-new-transformer-to-modify-schema-easily.html
'ERROR |XLSX Writer: No DEF line could be found for feature type 'test'. If you are using dynamic schemas, ensure that the fme_feature_type attribute exists on the incoming feature and corresponds to a valid feature type definition'
Even if I set the Excel Sheet name to 'fme_feature_type', I still get an error. Any ideas as to what the problem could be?
'ERROR |XLSX Writer: No DEF line could be found for feature type 'test'. If you are using dynamic schemas, ensure that the fme_feature_type attribute exists on the incoming feature and corresponds to a valid feature type definition'
Even if I set the Excel Sheet name to 'fme_feature_type', I still get an error. Any ideas as to what the problem could be?
Thanks. I created the sample Excel File and read it using the Schema (Any format) reader. The results are below. I'm not sure how this will help me debug though...
Sample Excel File
BOROUGHROAD_DESC0.25m to 0.5m_AREA_M20.1m to 0.25m_AREA_M2Test boroughTest road description546.222111122.8766Schema (Any Format) Reader output in Inspector
fme_feature_type_namefme_format_long_namefme_format_short_namefme_basenameSheet1Microsoft ExcelXLSXRTEST_SCHEMASheet2Microsoft ExcelXLSXRTEST_SCHEMASheet3Microsoft ExcelXLSXRTEST_SCHEMAThanks,
Thanks. I created the sample Excel File and read it using the Schema (Any format) reader. The results are below. I'm not sure how this will help me debug though...
Sample Excel File
BOROUGHROAD_DESC0.25m to 0.5m_AREA_M20.1m to 0.25m_AREA_M2Test boroughTest road description546.222111122.8766Schema (Any Format) Reader output in Inspector
fme_feature_type_namefme_format_long_namefme_format_short_namefme_basenameSheet1Microsoft ExcelXLSXRTEST_SCHEMASheet2Microsoft ExcelXLSXRTEST_SCHEMASheet3Microsoft ExcelXLSXRTEST_SCHEMAThanks,
Thanks. I created the sample Excel File and read it using the Schema (Any format) reader. The results are below. I'm not sure how this will help me debug though...
Sample Excel File
BOROUGHROAD_DESC0.25m to 0.5m_AREA_M20.1m to 0.25m_AREA_M2Test boroughTest road description546.222111122.8766Schema (Any Format) Reader output in Inspector
fme_feature_type_namefme_format_long_namefme_format_short_namefme_basenameSheet1Microsoft ExcelXLSXRTEST_SCHEMASheet2Microsoft ExcelXLSXRTEST_SCHEMASheet3Microsoft ExcelXLSXRTEST_SCHEMAThanks,
You should probably also set fme_feature_type_name = fme_feature_type
WARN |Cannot define schema for 'RP_200' as the feature does not contain schema information, and schema source is set to 'Schema from Schema Feature'. Please verify writer feature type configuration.
WARN |Cannot define schema for 'RP_200' as the feature does not contain schema information, and schema source is set to 'Schema from Schema Feature'. Please verify writer feature type configuration.
I am reading in three separate files as part of this workflow. I have only exposed fme_feature_type for the file from which I am using the geometry. Could this be causing any issues?
I am reading in three separate files as part of this workflow. I have only exposed fme_feature_type for the file from which I am using the geometry. Could this be causing any issues?
'ERROR |XLSX Writer: No DEF line could be found for feature type 'test'. If you are using dynamic schemas, ensure that the fme_feature_type attribute exists on the incoming feature and corresponds to a valid feature type definition'
Even if I set the Excel Sheet name to 'fme_feature_type', I still get an error. Any ideas as to what the problem could be?
1. In my output attributes, all my attributes have "(encoded: utf-8)" after them. Eg: "attribute(0).name (encoded: utf-8)", whereas when I inspect the FeatureReader using the sample excel file, it says "attribute{0}.name (string)".
2. The FeatureReader inspector outputs a "attribute{0].native_data_type (string)" feature which I have not defined in my real workspace. Do I need to generate these for all the attributes?
Also, one question: What do I set the "fme_feature_type" and "fme_feature_type_name" to? At the moment I have set them to the name of the Sheet I am outputting in Excel. But should they be set to something else?
1. In my output attributes, all my attributes have "(encoded: utf-8)" after them. Eg: "attribute(0).name (encoded: utf-8)", whereas when I inspect the FeatureReader using the sample excel file, it says "attribute{0}.name (string)".
2. The FeatureReader inspector outputs a "attribute{0].native_data_type (string)" feature which I have not defined in my real workspace. Do I need to generate these for all the attributes?
Also, one question: What do I set the "fme_feature_type" and "fme_feature_type_name" to? At the moment I have set them to the name of the Sheet I am outputting in Excel. But should they be set to something else?
No 2: Yes, I'd try it, but I'm not sure that's really the problem
No 3: Yes, the name of the sheet should be ok.
I also recommend you look (again?) at the sample workspace I've posted elsewhere in this thread.
No 2: Yes, I'd try it, but I'm not sure that's really the problem
No 3: Yes, the name of the sheet should be ok.
I also recommend you look (again?) at the sample workspace I've posted elsewhere in this thread.
Are you able to tell me what this error message means: 'No DEF line could be found for feature type 'xxx'?
Are you able to tell me what this error message means: 'No DEF line could be found for feature type 'xxx'?
Are you able to tell me what this error message means: 'No DEF line could be found for feature type 'xxx'?
Make sure that your schema feature comes before any data features!
Are you able to tell me what this error message means: 'No DEF line could be found for feature type 'xxx'?
https://knowledge.safe.com/questions/62902/error-no-def-line-could-be-found-for-feature-type.html
In the meantime I will try to recreate the error in a minimal workspace.
Thanks,
https://knowledge.safe.com/questions/62902/error-no-def-line-could-be-found-for-feature-type.html
In the meantime I will try to recreate the error in a minimal workspace.
Thanks,