Create rows from a comma seperated pack formula result

Some of the pack formulas return a list of comma delimited results. I have found it useful to have a a way to insert these into a table and here is how we go about doing it -

I am using the Stock pack as an example here.
Stocks::News() returns a comma delimited list of rows.

I created a table called Unpack and a button.
The button uses formulamap() and AddOrModifyRows to insert new results into the table.

Formula used -

FormulaMap(Stocks::News(),AddOrModifyRows(Unpack,News=CurrentValue,News,CurrentValue) )

Feel free to make a copy of this doc and play around -

5 Likes

Thanks for this example, however, Iā€™m hitting an obstacle. Is there any way to parse comma delineated data that is in a single cell of a table?

For example, if a cell of a table contains ā€œApple, Peach, Orangeā€, I cannot seem to make FormulaMap recognize that as a list and/or separate items.

Iā€™ve tried List and ListCombine, and even pulling the data out of the table into a standalone formula similar to the packs example you gave.

@Joseph_B - Try first splitting the string ( ā€œApple, Peach, Orangeā€) to a list and then working off that. Right now it is a string and not a list.
So, Split(ā€œApple, Peach, Orangeā€,",") will give you a list with Apple, Peach and Orange in it.

1 Like

It seems that coda has changed and this does not work anymore - not in your example either.

Iā€™m sure it will be an easy fix, but it would be illustrative to see what the fix is. I tried split(), but to no avail.

Maybe the News are empty? But how?
image