Skip to main content
Question

How to access the iteration count attribute in a FMX

  • November 20, 2020
  • 2 replies
  • 69 views

barrett_h
Contributor
Forum|alt.badge.img+1

Hi all,

Hopefully a simple question! I have a custom transformer that I have exported to a FMX as it contains blocking transformers and looping. I want to use the iteration count value to calculate another attribute value but I cannot for the life of me work out how to access the iteration count attribute from within the workspace.

 

iteration_countThanks for your help.

Cheers,

Barrett

2 replies

nampreetatsafe
Safer
Forum|alt.badge.img+13

@gio​  provides a strategy for accessing the "Attribute to hold iteration count" in this post: https://community.safe.com/s/question/0D54Q000080hdrkSAA/how-to-expose-attribute-iteration-count-in-a-loop


alexlynch3450
Contributor
Forum|alt.badge.img+14

Or a simplified method could be to:

1) Edit definition for $(ITERATION_COUNT_ATTR) >

1.1) make it private parameter

1.2) set value to '_iteration_count' --can be any text, but I borrowed this value from your example above.

2) add AttributeCreator and create new attribute '_iteration_count' with attribute value = $(INTERATION_COUNT_ATTR)Screenshot 2020-12-01 134720<==1

Screenshot 2020-12-01 134832<==2

 

Hoped this helped!😎


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings