If you queried an e-commerce API for a user's purchase history and received a result with a list attribute containing all their purchases, which transformer could you use to generate one feature per purchase?

Prepare for the FME Certified Professional Exam. Study with flashcards and multiple-choice questions; each question includes hints and explanations. Ensure your success!

Multiple Choice

If you queried an e-commerce API for a user's purchase history and received a result with a list attribute containing all their purchases, which transformer could you use to generate one feature per purchase?

Explanation:
When you have a list attribute with multiple purchases and you need each purchase represented as its own feature, you want to split that list into separate features. The transformer that does this is ListExploder. It takes a feature containing a list and creates a new feature for every item in that list, preserving the rest of the attributes (like user ID) so you end up with one feature per purchase. This is perfect for turning an API’s array of purchases into a row-per-purchase dataset. Other transformers don’t serve this exact purpose: ListConcatenator merges lists into a single list, not into multiple features; ListIndexer applies or creates indices within a list; ListSorter just orders elements within a list but keeps them in one feature.

When you have a list attribute with multiple purchases and you need each purchase represented as its own feature, you want to split that list into separate features. The transformer that does this is ListExploder. It takes a feature containing a list and creates a new feature for every item in that list, preserving the rest of the attributes (like user ID) so you end up with one feature per purchase. This is perfect for turning an API’s array of purchases into a row-per-purchase dataset.

Other transformers don’t serve this exact purpose: ListConcatenator merges lists into a single list, not into multiple features; ListIndexer applies or creates indices within a list; ListSorter just orders elements within a list but keeps them in one feature.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy