Create rows from a comma seperated pack formula result

#1

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

#2

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.

0 Likes

#3

@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