Make a string and save

Hello guys.
I want to make a string from inputs but … .
i have set twitter api to get tweets.then extract title, date, user and make a string.then save it as a txt file.
but i don’t know what to put after twitter node.
i want to make something like this for output :

There is tweet from {{$json["user"]["screen_name"]}} :
text : {{$json["full_text"]}}
link : https://twitter.com/{{$json["user"]["screen_name"]}}/status/{{$json["id_str"]}}

thanks.

Information on your n8n setup

  • n8n version: latest
  • Database you’re using (default: SQLite): dafault
  • Running n8n with the execution process [own(default), main]: own
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]: Docker, ubuntu 20

Hi @rhodesgod

You can use the Write Binay File node to save the text into the file.

Please note that, I have used Set node instead of Twitter Node (Just for the example)

This node needs two parameters.

image

You can edit the file path under the Final Name and leave the Property Name as it is. (Which can be later used, If you want to access the file in other nodes within the Workflow.)

Hope it helps.

1 Like

thanks.but i know how to save the file.

i don’t know how to make string from twitter output and make it as input for txt file.
which node should i use?
it gets some data from twitter output. put the information in a sentence and send the result as output for saving in txt file

thats the problem

1 Like

What exactly you wanna save as string? You will need to manipulate data probably with function node. Share your workflow and let us know what needs to be save as txt file

Hey @rhodesgod,

Looking at what you want to do the example at the bottom should cover it.

So I have a set node to Fake the data to match what you are sending so consider that your Twitter node, The Next set node uses the data to build out the message to save in the text file. Next up is to convert the JSON data to Binary data using the Move Binary Data node then we end by using the Write Binary Data node to save the file wherever you want it.

Example Workflow

The only problem you may have depending on your setup is if the Path you use for the Write Binary File exists and is available to your docker container.

2 Likes

thanks.
Create file data node is what i wanted.
solved

1 Like