Skip to main content
Question

Count number of records for update and create, then expose it as attribute

  • April 19, 2018
  • 2 replies
  • 432 views

I’ve spent all day searching for my answer on your FME Q&A; Forum but couldn’t find right answer for me. What I like to achieve.

1. Read file names only with extension .json from specific folder

2. Get list of file names from URL using HTTPCaller

3. Check to see if each file names are contained in list

4. If file exist,

- Increment counter for update

5. If file does not

- Increment counter for create

5. Once all the records are processed, then

- Create email content (2 lines)as follow:

# of records updated: xxx (counter)

# of records created: xxx (counter)

6. Sends Email – replaced with inspector for now.

 

 

I tried adding Aggregator before I sent email but it doesn’t preserve counter information.

I have attached working workbench and will also post it to FME Q&A; Forum.

Thank you

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

oscard
Influencer
Forum|alt.badge.img+22
  • Influencer
  • 344 replies
  • April 19, 2018

There is a Custom transformer called "FeatureCounter". I think it does what you are looking for.


takashi
Celebrity
  • 7843 replies
  • April 21, 2018

Hi @jysuh1013, I think you can replace the Counters with AttributeCreators to assign 1 to the count attributes to let the Aggregator to count the number of features coming from each feature flow. If the number of features was 3, for example, the sum of count attribute will be 1 + 1 + 1 = 3, that is equal to the number of features.