Solved

How to expose file name as fme_feature_type attribute value


Badge +6

I'm using FeatureReader as CSV format and trying to expose attribute 'fme_feature_type'. It's returning NULL or CSV. Instead it has to return FILENAME.

Any thoughts please?

icon

Best answer by rylanatsafe 4 January 2018, 00:52

View original

12 replies

Badge +2

Hi @fmeuser_gc

 

Try fme_basename or fme_dataset as the attribute to expose instead.

Whatever the brown feature type on the canvas is saying, that's the attribute value you'd get when using fme_feature_type.

Badge +6

Hi @fmeuser_gc

 

Try fme_basename or fme_dataset as the attribute to expose instead.

Whatever the brown feature type on the canvas is saying, that's the attribute value you'd get when using fme_feature_type.

Hi @jlutherthomas, no it still returns NULL values.

 

Userlevel 2
Badge +16

I have seen this before, but only in the Data Inspector (version of the transformer is 5, works OK with version 4).

If you write the data to an output format, does it still remain NULL?

In my case it showed the file name in the output, but not in the Data Inspector, even though it was exposed.

Badge +6

I have seen this before, but only in the Data Inspector (version of the transformer is 5, works OK with version 4).

If you write the data to an output format, does it still remain NULL?

In my case it showed the file name in the output, but not in the Data Inspector, even though it was exposed.

Hi @erik_jan, I get nothing in both Data inspector and Output format.

 

Badge +2
Hi @jlutherthomas, no it still returns NULL values.

 

Can you expose it using the AttributeExposer rather than on the feature type?
Badge +6
Can you expose it using the AttributeExposer rather than on the feature type?
It still returns defalut 'CSV' value. Actually looking for name of file

 

 

Badge +11

@fmeuser_gc - Try using an AttributeManager after the FeatureReader to create a new attribute that references fme_feature_type as the value. I've attached a workspace template created using FME 2017.1.2 Build 17722 that demonstrates this.

The fme_feature_type remains null, but my new attribute _fft is populated and writes out correctly (using native CSV Writer).

Hope this helps!

fme-feature-type-2017.fmwt

 

Edit: The display issue with fme_feature_type values in the FME Workbench Canvas and FME Data Inspector is no longer observed with FME 2018.0 Build 18240 or Newer.
Badge +2
It still returns defalut 'CSV' value. Actually looking for name of file

 

 

 

Have you tried exposing fme_basename or fme_dataset instead of fme_featuretype? The feature type is CSV in your case, so you need a different attribute
Badge +2

The answers here may be useful, especially the one from Takashi: https://knowledge.safe.com/questions/52039/what-do-fme-dataset-fme-basename-and-fme-feature-t.html

Badge +6

@fmeuser_gc - Try using an AttributeManager after the FeatureReader to create a new attribute that references fme_feature_type as the value. I've attached a workspace template created using FME 2017.1.2 Build 17722 that demonstrates this.

The fme_feature_type remains null, but my new attribute _fft is populated and writes out correctly (using native CSV Writer).

Hope this helps!

fme-feature-type-2017.fmwt

 

Edit: The display issue with fme_feature_type values in the FME Workbench Canvas and FME Data Inspector is no longer observed with FME 2018.0 Build 18240 or Newer.
Hi @RylanAtSafe, this worked. I've just changed the Feature Type Name(s) for Dataset parameter as there is no 'AttributeManager' transformer in 2015.1 version.

 

 

Thank You for your reply.

 

Badge +6
Hi @jlutherthomas, this is useful info for sure. Thank You.
Badge +11
Hi @RylanAtSafe, this worked. I've just changed the Feature Type Name(s) for Dataset parameter as there is no 'AttributeManager' transformer in 2015.1 version.

 

 

Thank You for your reply.

 

Glad to hear it! Thank you for following up here.

 

 

Reply