Answers for "How to expose all attributes in generic way? Any "magic" parameter in AttributeExposer or Python Script?" https://knowledge.亚搏在线safe.com/questions/32777/how-to-expose-all-attributes-in-generic-way-any-ma.html The latest answers for the question "How to expose all attributes in generic way? Any "magic" parameter in AttributeExposer or Python Script?" Answer by dbaldacchino1 https://knowledge.safe.com/answers/80437/view.html

Wanted to add a quick follow-up to my question above.After reading & understandingthe following postby@BrianAtSafe, I was able to do the following to solve my problem, avoiding the above mentioned workaround (no need to use a user parameter to expose the attribute):

I used an AttributeKeeper to only keep the attributes in the list I needed (just the first one).We only need to merge this data with the first feature, so in that case use a sampler (1st N items, 1 item) to merge on that one only.When doing this, I found it necessary to use a counter before merging, then sort by the count attribute to ensure the first feature has the attribute list.But since I needed to run a tester to filter out unwanted features that resulted from an AttributeExploder (specific to my workflow), I just merged all features and avoided the Counter, Sampler and Sorter.Hope this helps somebody!

Sun, 14 Oct 2018 20:58:48 GMT dbaldacchino1
Answer by dbaldacchino1 https://knowledge.safe.com/answers/75847/view.html

Thanks for that explanation@david_r.Honestly I have struggled to understand Dynamic workflows (I haven't needed them really so that makes it even harder to fathom!) but now I'm starting to understand a little more.At least I know I cannot be chasing a solution that is not actually possible.So for my current workflow I ended up adding a user parameter that takes a string to define the header text by the user at run-time and it uses that parameter to expose the attribute.That's as "dynamic" as I can make it I suppose :)

Tue, 07 Aug 2018 15:43:35 GMT dbaldacchino1
Answer by dbaldacchino1 https://knowledge.safe.com/answers/75842/view.html

Hi@david_r, I am looking to solve this exact same issue but cannot figure out what the suggested solution is.In my case I want to read some external data (Excel files) with a FeatureReader.The schema can be different between files so I'm using the Generic port.The basic structure of the Excel files will be the same: they will start with a column that contains an ID, but the header of the column might be different (hence why I cannot just statically specify that value).When I look at the data that is read, I DO see the attributes in Inspector, but without exposing them, I cannot do anything in the workspace.For example I manually exposed Asset ID# but not the highlighted ones, yet they show up in Inspector:

...but not in the workspace:

The suggested solution above mentions the AttributeExploder transformer, but how would that help?I already have the schema coming out of the FeatureReader but cannot figure out how to feed that dynamically into an attribute exposer (doesn't seem possible to read actual attributes dynamically and converts everything to a string).Any explanation/clarification/solution would be greatly appreciated!

Tue, 07 Aug 2018 15:06:12 GMT dbaldacchino1
Answer by david_r https://knowledge.safe.com/answers/32780/view.html

Hi, a quite similar question was answered recently, have a look here:https://knowledge.safe.com/questions/32483/dynamic-attributes-in-custom-transformer.html

Let us know if you think your case doesn't apply.

Thu, 25 Aug 2016 09:43:40 GMT david_r