Skip to main content
Solved

How to expose file name as fme_feature_type attribute value


fmeuser_gc
Contributor
Forum|alt.badge.img+8

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?

Best answer by rylanatsafe

@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.
View original
Did this help you find an answer to your question?

12 replies

Forum|alt.badge.img+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.


fmeuser_gc
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • January 3, 2018
jlutherthomas wrote:

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.

 


erik_jan
Contributor
Forum|alt.badge.img+17
  • Contributor
  • January 3, 2018

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.


fmeuser_gc
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • January 3, 2018
erik_jan wrote:

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.

 


Forum|alt.badge.img+2
fmeuser_gc wrote:
Hi @jlutherthomas, no it still returns NULL values.

 

Can you expose it using the AttributeExposer rather than on the feature type?

fmeuser_gc
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • January 3, 2018
jlutherthomas wrote:
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

 

 


rylanatsafe
Safer
Forum|alt.badge.img+13
  • Safer
  • Best Answer
  • January 3, 2018

@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.

Forum|alt.badge.img+2
fmeuser_gc wrote:
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

Forum|alt.badge.img+2

fmeuser_gc
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • January 4, 2018
rylanatsafe wrote:

@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.

 


fmeuser_gc
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • January 4, 2018
jlutherthomas wrote:
Hi @jlutherthomas, this is useful info for sure. Thank You.

rylanatsafe
Safer
Forum|alt.badge.img+13
  • Safer
  • January 4, 2018
fmeuser_gc wrote:
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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings