I want to add a new raw using Cross-Doc pack using formula - AddRow(shared account, doc url, “Text”, Value)
the Value in the formula is displayed in the first screenshot.
The second screenshot shows what value was added as a result to another document.
The problem is that the formatting is lost.
Hey Nikita! This sounds like a feature request the Coda team has been tracking. That said, we have moved this post into the Suggestion Box for other members of the Community to chime in on this. We’ve gone ahead and tracked your vote for this feature formally.
First, don’t use Cross-doc Actions but better use a webhook. There is a free pack in the Gallery for sending webhooks or you can create one yourself, the code is like 20 lines.
Second, for rich text you have to send JSON representation of the rich text object, and on the receiving side convert it back into text.
Button action:
CallWebhook(
<URL>,
<TOKEN>,
Object("text", If(
thisRow.[Is rich],
thisRow.Text._Merge(), // include the object for the rich text
thisRow.Text // not a rich object - send value as is
))
)
My solution still works, so it’s something is with the webhook pack you use.
You don’t send an object there — you’re sending key/value varargs. My guess is that the pack treats the arguments as text and instead of sending the object to the webhook as is, it basically turns that Text._Merge() to string (escapes it).
I probably should just publish my webhook pack to the gallery. Initially I didn’t want to do this because I thought publishing my pack while there was already one wouldn’t be very ethical. However I see there are already multiple webhook packs in the gallery so there’s no more reason not to publish mine too.
You can use this pack bellow. It’s based on (almost copied from) @Paul_Danyliuk webhook. I tried the other pack in the gallery that is free but I had some issues trying to send values other than text (lists for example)
I kept open source so you can create any modifications you want.