I’m building an integration where items in Pocket are sent to a Notion database as items. I need to extract the tags from Pocket and add them as a comma-separated string to a text parameter called “tags” in Notion. I’m having trouble figuring out how to convert the Pocket tags, which are stored as a dictionary in the collection, into the required string format. I’ve tried using parsing modules, regex, and iteration, but I’m missing something. Can you help me extract the tags from the Pocket collection and format them as a string in the format “to_read, web3” for use in Notion?
Acording to ChatGPT here’s the solution if I were to write this in a python script:
tags = pocket_collection['tags'] # Extract the tags field from the Pocket collection
tag_names = list(tags.keys()) # Get a list of all the tag names
formatted_tags = ", ".join(tag_names) # Concatenate the tag names into a single string
TY @Jan_Knettig !! the caveat is that those tags are dynamic and therefore I have no idea if it’ll be 1 tag or 20 nor what they’ll be. SO my goal is to convert them from the array/collection to a csv format so that notion can then use it.
Hi @Jan_Knettig! I seem to be able to get it to work if I use the json in the “text parser” module. however, if I reference the field coming from pocket “tags” it get’s an error “Collection can’t be converted to text for parameter ‘text’.”: