Skip to main content
Question

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


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

2 replies

oscard
Influencer
Forum|alt.badge.img+21
  • Influencer
  • April 19, 2018

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


takashi
Supporter
  • 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.


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