Create Doc Button

I would like to have the ability to create a number of different documents (from templates) based on parameters on my “Admin” doc. For example, I would be able to select the ‘employee’ and the ‘doc type’ from select menus, and use those as parameters for my createDoc(employee, docType). This would then create a copy of the template (invoked by docType), customized to the specified employee.

Is this something that anyone has done? I am open to all tips, I’m very much a n00b.

Thank you!

Yes! You absolutely can do it. I’ve done almost the exact same thing and have the pack working for a client.

You just need to create a pack for it. Have you built Packs before? Whats your Javascript knowledge like?

Thanks so much for the quick help, Scott! I have a little experience in packs and minimal javascript skills. What I’m currently hung up on is the language inside the formula itself. I’ve been able to just copy template scripts to create the rest of the structure but am not sure where to look to find documentation on telling Coda to create a new document. Do you have any tips? Thank you!

Unfortunately you won’t be able to do that directly within Coda and with native features itself, you would need to develop a pack for it.

The pack-studio is very friendly to those who have minimal javascript knowledge and the community is extremely helpful as you make packs of your own.

@Eric_Koleda is a developer advocate at Coda and can also provide TONS of resources. @Thomas_Baucom is another individual who also has started to build packs with little to no Javascript knowledge prior and can definitely give some tips!

If you need it built fast though or don’t have the time to sharpen your Javascript skills, your best bet would be to post in the #marketplace:requests-gigs channel so that someone could make it for you!

Let me know how else I can help!

3 Likes

Curious Scott, did you use the Coda API in a pack to achieve this?

Yes I did sir!

I’ve built a couple iterations of them for myself and for clients

… Coda Pack, Coda API

Yep, thought so.

In @Sarah_Heyborne1’s case, she’d have to learn not only enough Javascript to build a pack, but another steep climb awaits with the Coda API. Certainly this is possible and we can see the light at the end of that tunnel, but for most users, this is a big bite of the apple.

I also think this is likely a nice opportunity for a Pack developer to make a universal solution to automated document creation and permission settings. Although @Sarah_Heyborne1 didn’t stipulate this, it would seem that assigning ownership to the target user might also be beneficial, although I have not thought through all of the security aspects of doing that. I don’t think the API supports this, but I haven’t really looked that closely.

This requirement certainly seems worthy -

  • Given this doc (or template) ID…
  • Build a copy of it…
  • Customize it…
  • Share it (or grant ownership) to a given user ID.

For a variety of use cases, this would make the life of Makers more automated and allow my laziness to shine through. :wink:

Haha challenge accepted - Ill try to take my more private/specific packs and make them available for general use.

There are SOME hiccups . . . But let me look into it

Also happy to make it for you @Sarah_Heyborne1 if you want to chat about that, send me a DM or shoot me a message at scott@simpladocs.com

1 Like