Skip to main content
Question

How to access the iteration count attribute in a FMX

  • November 20, 2020
  • 2 replies
  • 98 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

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

nampreetatsafe
Safer
Forum|alt.badge.img+13
  • Safer
  • 383 replies
  • December 1, 2020

@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+15
  • Contributor
  • 68 replies
  • December 1, 2020

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!😎