Question

Table name as attribute prefix

  • 10 February 2022
  • 5 replies
  • 16 views

Badge +4

Hi. I am joining lots of sql tables together in FME and there are a few that contain the same field names. So both fields are preserved and I know which one I am looking at I want to prefix all attribute manes with the table name (similarly to how joins show in ESRI)

 

I have used the BulkAttributeRenamer to manually type the table name in, but am after something a bit more automated. I have also tried exposing the fme_feature_type and using this as a prefix in the BulkAttributeRenamer but all fields then come back as missing. What is the best way of acieiving what I am after?

 

Thanks


5 replies

Badge +10

When you say the attributes are missing? Do you mean missing or are they just unexposed?

 

Badge +4

they appear with the original name (no prefix) and the values are all 'missing'

Badge +10

So if you click on the feature and look at it in the FeatureInformation window, you should see your new attributes there with values. Because you are using a dynamic value within the BulkAttributeRenamer, you won't see them exposed on the canvas

Badge +4

Ok thanks. That's not a working solution for me then. I need to be able to see the field names in the workbench as I go along so I know what fields are from what tables. Looks like its a case of manually copy and pasting it for every table I bring in.

 

Personally I wish there was just a check box to add the table name to the field name without having to add a bulk attribute renamer in in the first place.

Userlevel 4
Badge +25

Ok thanks. That's not a working solution for me then. I need to be able to see the field names in the workbench as I go along so I know what fields are from what tables. Looks like its a case of manually copy and pasting it for every table I bring in.

 

Personally I wish there was just a check box to add the table name to the field name without having to add a bulk attribute renamer in in the first place.

Which transformer are you using to perform the join? E.g. the FeatureMerger has an option to prefix supplier attribute names in case of conflicts.

 

Alternatively, you can prefix the attribute names before the join.

Reply