Skip to main content

I'm having a custom transformer that needs an URL as input for API calls, so I made it a user parameter

However if I take the value from an attribute, that value is lost after another custom transformer that contains a list builder. If the value comes from another user parameter (set in the main), there is no issue:

This is the setting by taking the url from an attribute (table shows the output from a parameter fetcher inside the custom transformer after the list builder CT)

url from attribute 

This is how it is by taking the value from another user parameter (+ output from same parameter fetcher):

From another user parameter it works 

Is this a bug? Am I missing something?

How could I solve this in a performant way?

Is there a way to change a value from a user parameter to an attribute value? Say I define user parameter "URL" as private one and leave it empty. After I deduct what the URL should be (fetched from a database), can I add the fetched value to the empty user parameter?

 

 

 

Yeah, I've had an issue like this in the past. Not really sure how I solved it, however, what works well for me now is to just expose the attribute in the CustomTransformer input port which automatically creates and exposes the attribute.

I think the issue comes when creating the parameter from a field (or a type) which doesn't support having attribute values applied to it. Can you remember how you created the problem attribute?


The attribute is a string (UTF-8) that is fetched from a variable retriever, but even if I create an attribute from attribute manager, result stays the same.

Ideally I want to avoid exposing it in the CT because I would then need to take it along also when working with lists (same issue I have with variable retriever, seems that the listbuilder blocks variables from setter and parameters derived from attributes)


Hmm so when I replace the list builder with an aggregator with similar setup as list builder (same group by), when I say merge incomming attributes, it does keep the user parameters (which aren't exposed in any way).

So it solves my use case (+ I don't need to use list concatenate separately as the aggregator can concatenate in 1 go). Still if a someone from Safe can look at this to say if this is desired behaviour from the list builder (to forget about user parameters that aren't exposed)


Not sure if this is your exact issue, but if your custom transformer's parameters are set by an attribute value on the outside, then those parameters behave like an unexposed attribute and not like a global parameter than can be accessed at any point within the custom transformer.

So if inside the custom transformer you have an AttributeKeeper, then try fetch the parameter which 'aa_entity_id' has, it'll be missing. You have to be careful about any transformer that drops attributes inside a custom transformer if its parameters are set by attribute values.


Reply