Export a dataset with optional columns to database

I have this database with a table containing let’s say 15 columns.
The input is a WEB API request, which I need to iterate through, because max results is 100 lines. This is no problem, but the problem comes in, if one of the interations only contains for example 14 columns, because in that specific iteration, no data is filled in 1 column.
Exporting to my DB fails, because it expects 15 columns, not 14. I made a workaround but it’s rather complicated. Do you have any smart suggestions on how to handle this?

On the forum there are answered questions regarding optional columns. Here is one of them:

oke, it’s less easy than I thought. What I did, was I just predefined the columns that I should expect and then append the data against those columns. So column will exist but will stay empty if there is no data against. Seems like there is easier solution for this.

When field is optionnal if empty, I create it in EasyMorph because EasyMorph can’t do without these fields.

  1. Create fields list

image

  1. Create field “data” empty

image

  1. Pivot

image

  1. Append another table in columns

image

Result is right after “keep” because if column already exist, new column are names with “(2)” in end of name.

image