Skip to main content
Solved

How to write dynamic attribute names ?

  • January 20, 2023
  • 2 replies
  • 197 views

Forum|alt.badge.img

Hi All,

I'm trying to create and write dynamic attribute name with the joined workspace.

 

In a FFS file, I have C-SEGMT entities. I would like to count how any entities I have until the current year (e.g. 2023) but also for the two previous years (e.g. 2022 and 2021) and put the result in a dynamic attribute name (for my example, three attributes named "NumEntities__2023", "NumEntities__2022" and "NumEntities__2021"

 

I can create them, as you can see it in my Workbench and the screen capture, but I don't know how to write them in my Writer. It's OK for a FFS Writer, but if I want to write in a GEOJson file or other formats, it fails.

 

I could name them directly "NumEntities__2023", "NumEntities__2022", "NumEntities__2021" ; or I could expose them with AttributeExposer : I can see their name if I have enabled feature caching. But my goal is, if I run the workbench next year, the attributes will be automatically renamed "NumEntities__2024", "NumEntities__2023", "NumEntities__2022".

 

Does anyone has any idea ? The attributes must be in the same file and same FeatureType, so I can't use the fanout option (but maybe I have used it wrong). Published Parameter ?

 

Many thanks !

Have a good day

Best answer by nielsgerrits

Please check Tutorial: Dynamic Workflows and more specific Dynamic Workflows: Destination Schema is Derived from a Schema Feature

 

I think I would use the SchemaScanner to create a Schema Feature and use that to write the schema dynamic as data defines it.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

nielsgerrits
VIP
Forum|alt.badge.img+60
  • 2938 replies
  • Best Answer
  • January 20, 2023

Please check Tutorial: Dynamic Workflows and more specific Dynamic Workflows: Destination Schema is Derived from a Schema Feature

 

I think I would use the SchemaScanner to create a Schema Feature and use that to write the schema dynamic as data defines it.


Forum|alt.badge.img
  • Author
  • 4 replies
  • January 20, 2023

Please check Tutorial: Dynamic Workflows and more specific Dynamic Workflows: Destination Schema is Derived from a Schema Feature

 

I think I would use the SchemaScanner to create a Schema Feature and use that to write the schema dynamic as data defines it.

Hi Niels,

 

It perfectly works ! The tutorial is clear enough to get what I want.

 

Many thanks

Have a good day