Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Implementing a field that is an array of strings (aka tag list)

default discord avatar
lzyac6 months ago
2

Basically want to have an array of text fields - the number of which is unknown. How can I achieve this?



Implementing a field that is an array of strings (aka tag list)



the API response would look something like this for a doc in the collection:



{
  "id": "nmjhy7asudhjahsgfdg",
  "customListField": ["Item 1", "Item 2", ",to...,", "Item n"]
  // additional fields...
}


OOOH



livesaver



thanks



didn't appear obvious to me



so i assumed it wasn't part of the text field docs 😅



allg i just wanted a hashtag list



like you see on youtube



the text hasMany will work perfect



thanks again :)

  • default discord avatar
    ritsu045510 months ago

    Text type field has "hasMany" property, have you seen that?



    Number has it too



    Just in case



    I haven't ever used though them

  • default discord avatar
    mabel_525507 months ago

    Is there a way to edit the text once it's been entered in a hasMany field? I am looking to make a list of sentences, but I don't want to use an array because it adds unecessary complexity. It has seemed like text hasMany option only shows a snippet of the text once you hit "enter" and then the full text is no longer viewable or editable, though you can rearrange it.

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.