Word Object gets appended instead of the object itself

I am trying to append the list of objects from result of twitter’s advanced search to google docs .
But when I have added the data pill it shows the word “Object” getting appended in the google docs instead of the values of list of object.

Hello @radhikakondapaneni, the reason for this is because the expression ((steps.advanced search.$return _value}) in your Text prop refers to a JSON array of object. The [Object object][Object object]... string is the result of Pipedream action parsing that value into string.

So in order to send the desired text to Google Docs, you need to map each object in the array to a string, and concatenate them into a single string.
For example:

(( steps.advanced search.$return _value.map(obj => obj.full_text).join('\n') })

With the $result_value:

[ {full_text: "this is text1"}, {full_text: "this is text2"}, ]

This expression will output the value like this in the Google Docs:

This is text1
This is text2

My test

1 Like

Got it . Thanks for your information !

@vunguyenhung but what if I need to post the whole information of object (created at , id and so on ) instead of only full text . Then what should I do?

Hello @radhikakondapaneni, it depends on how you want to present the information on the Google Docs. For example, you can concatenate all the information into a string and have it print in one line:

(( steps.advanced search.$return _value.map(obj => `${obj.full_text} - ${obj.created_at} - ${obj.id}`).join('\n') })
1 Like