Merging tables when one table might not contain data

I’m building a flow that is receiving data from three separate API imports. It’s not guaranteed that the flow will receive data from all imports consistently. One certain days, one or more of the imports might not contain any data. At the end of the flow, I need to merge data from the three imports into a single table before exporting that to box.com.

I thought using an if/else statement just after the API imports could stop processing on one of those three streams if data isn’t received, so that I could exclude that stream from the table merge.

But, it seems that the if/else step assumes data has been received and expects column values. How can I check whether data has been received, and if not, exclude from the remainder of the flow?

Hey Michael! Is it safe to assume that at least 1 of your API Imports would contain data every time the flow runs? The solution I’m offering below would only run successfully if at least one of the API Imports receives data. If none of them receives data, the run will result in an error and try again whenever it’s scheduled to run next.

First, I recommend merging your API Imports into a single branch to avoid having to duplicate a bunch of transform steps.

Your resulting flow will look like this:

Add in this Text Merge step between the Column Filter and If/Else steps: parabola:cb:44f0cf29cbd44b12ba87ab9e3816db4b
Add in this Column Filter step between the Fill Down and Pivot steps: parabola:cb:42fa29a4c88e4877a0f60a4c765de8d3
(Just copy those snippets above and paste anywhere on your flow using your keyboard shortcut)

In the If/Else step after the Text Merge step, change the New Value selector in the rule to target the Temporary Key column. Make sure to check off the “Ref” checkbox.

The Text Merge step is necessary to create a Temporary Key column which we use to keep track of which rows belong to which import so that when we pivot the data, duplicate rows of the same ResultRow value are not lost.

Phew, I know that was a lot of info! Let me know how that goes, or if you have any questions.

Brilliant solution as always! Thanks Sachi.

3 Likes