Skip to main content

I'm trying to create multiple attributes during a loop depending on the amount X. If x = 3 the attributes created should be Foto_doc,Foto_doc2 and Foto_doc3.

I have a working flow with loop in the below example but the attribute creator does not work correctly with the @value(attribute_name) option. Is there something missing in this flow or is it not possible to use attribute values for naming attributes during a loop?

The image and the workspace you have posted cannot be accessed for some reason. Could you please make sure that those have been uploaded correctly?


The image and the workspace you have posted cannot be accessed for some reason. Could you please make sure that those have been uploaded correctly?

This should work now. Do not know what the problem was but i re-uploaded the file.


Corrected the x = 2 into x = 3 to match the named outcome correctly.


Like Takashi I cannot access your workspace, but in situations where @Value(attribute_name) hasn't worked in the past (double check that it's a capital V), I've had success with FMEFunctionCaller using the @SupplyAttributes(attrName,attrValue) function.


Like Takashi I cannot access your workspace, but in situations where @Value(attribute_name) hasn't worked in the past (double check that it's a capital V), I've had success with FMEFunctionCaller using the @SupplyAttributes(attrName,attrValue) function.

reuploaded the file. Also the image was missing now... hope it works now or it could be that the forum has a hard time.


It doesn't look like you are exposing the new attribute names?

 


It doesn't look like you are exposing the new attribute names?

 

Thanks! Forgot that attributes could be hidden. The attribute exposer does not allow a value from attribute as input. But with manual inspection in the data inspector I can now see that the attributes are created but not showed in the endresult. Also the format is not what i would like.

 

Also: to solve the 2.0,3.0 I used @Evaluate(@round(@add(@Value(loopCounter),1),0))


Dynamically named attributes cannot be automatically exposed on the canvas and used by other transformers.

 

 

You can write them to a format if you use the SchemaSetter custom transformer and a writer set to Dynamic Schema Definition.

 

 

Personally I wouldn't use a loop at all, just a Cloner set to Max_Images, and build the attribute name from the _copynum attribute. This would also avoid the formatting issues of 2.0, 3.0, though that could be taken care of using the StringFormatter.

Dynamically named attributes cannot be automatically exposed on the canvas and used by other transformers.

 

 

You can write them to a format if you use the SchemaSetter custom transformer and a writer set to Dynamic Schema Definition.

 

 

Personally I wouldn't use a loop at all, just a Cloner set to Max_Images, and build the attribute name from the _copynum attribute. This would also avoid the formatting issues of 2.0, 3.0, though that could be taken care of using the StringFormatter.

Schemasetter did the trick.

For the formatting: @Evaluate(@round(@add(@Value(loopCounter),1),0))


Reply