#How to create a custom button component in admin collection to sync data from external source

9 messages ยท Page 1 of 1 (latest)

cerulean heart
#

Hi,

I'm new to Payload and I'm trying to find out how to create a custom button/action in a collection in the admin panel.

The goal is to have a manual sync button that trigger a call to an external source API, to sync data from another source into payload custom collection.

I'm trying to do this with Payload 3, and all I found in the doc and Discord is a bit confusing for me as I'm new to Payload (and i'm not sure i'm on the right path). I'm looking for the smartest way to do this.
Is there a full example somewhere for instance ?

BTW, I think Payload is very nice and will have a great future ๐Ÿ™‚

Thanks for your help,
Damien

dense forge
#

Hmm, when u say sync data, do you need to change the value of other fields?

#

Because while making the button is easy, having it pass some value over to payload managed editable fields can be a bit tricky (from my half assed understanding of payload)

cerulean heart
#

@dense forge Thank you. Yes. Basically, I need to retrieve all the content from another system and add some meta data for SEO. All SEO data will be managed only in Payload. Yet, I don't want to edit the retrieved content. Isn't it possible to simply get the whole content and just update the fields coming from the other system ? For the button, do you have a complete reference to make it (whole example) ?

regal lily
#
Payload

Payload is a headless CMS and application framework built with TypeScript, Node.js, React and MongoDB

GitHub

Payload is the open-source, fullstack Next.js framework, giving you instant backend superpowers. Get a full TypeScript backend and admin panel instantly. Use Payload as a headless CMS or for buildi...

GitHub

Payload is the open-source, fullstack Next.js framework, giving you instant backend superpowers. Get a full TypeScript backend and admin panel instantly. Use Payload as a headless CMS or for buildi...

Payload

Payload is a headless CMS and application framework built with TypeScript, Node.js, React and MongoDB

scenic cobaltBOT
#

You cannot use this command in a community-help thread.

cerulean heart
#

Thank you @regal lily , it worked ๐Ÿ™‚

regal lily
#

Awesome ๐Ÿ‘