I created a pack for internal use that returns an object. The use case is that it posts/puts the coda data into a database so that my client can use coda as a gui for the database. The pack formula will then return an object with the id and slug of the data entry.
I have a button that execute the pack and everything works fine. But the button is suppose to modify a text field in the row and it only includes the first value. The docs says its suppose to be a chip, but I only get the first text value. Why is that?
Note I do have access to each property when I do postItem(…).Slug or postItem(…).Id I get the specific value returned…but I cant figure out how to use all the values at once. Ultimately, I want to place each value in its own column.
Button actions (aka formulas in pack code that include
isAction: true cannot return ACTUAL objects.
What I mean by ACTUAL objects are objects that appear in that nice little CHIP for coda users.
Your two options here are:
- Use ParseJSON() on the result of your button object to pull out the actual data
- Return the result of a button into a column, then run another formula on that result that returns that data as an actual Coda object
So ParseJSON on the button would return an “ACTUAL” object? I haven’t heard of isAction, where can I read about that?
I have since made the pack return stringified the object, put it in a column, and use ParseJSON to extract stuff from there. I guess it works…
What you said last was correct. You use the parsejson() formula on the coda side to extract the values from the json keys.
Pack buttons were really only designed to return strings, although I’ve begged @Eric_Koleda and the packs team to allow them to return actual objects!
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.