I made a collection of messages from a user using an aggregator and I am having trouble passing all these messages in one array to the chatgpt module, how do I do this.
Below are the screenshots
Help me please!
Hi @Alex23, That’s weird, your keywords join( map( should appear differently, in a gray bubble. They are Make native functions. If you copy-pasted them in, please type them out manually. syntax of ‘11.Array’ and ‘->’ has to be corrected. also, “\n” is newline function in Make.
Welcome to the Make community!
You can use the built-in function map
and join
e.g.:
{{ join(map(11.array; "record.question_from_user"); newline) }}
For more information, see the function documentation in the Help Center and do the tutorials in the Make Academy.
Here are some useful links and guides you can use to learn more on how to use the Make platform, apps, and app modules. I found these useful when I was learning Make, and hope they might benefit you too —
Getting Started
- Help Centre | Tutorials – Make “Manual”
- Make Academy – Basics 101: Learn Make and get certified
Help Centre Basics
- Mapping – What is mapping? What can I map?
- Mapping with arrays – How to map items in an array
- Aggregate an array for mapping complex fields
- Date Format: tokens for
parseDate
| tokens forformatDate
- HTTP modules – Make a request, Get (download) a file
- Webhooks – Error Handling, Responding to webhooks
Articles & Videos
- Router Magic Formula - YouTube
- Error Handlers in Make - YouTube playlist
- Getting started with OpenAI - How to setup and use OpenAI (ChatGPT) in Make
- How to use Regex in Make - How to use pattern matching to extract the text you want
- Webhooks – Make Academy – tutorial on how to use Webhooks
Hope this helps! Let me know if there are any further questions or issues.
— @samliew
P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.
Hi @kudracha & @samliew
I’ve tried different ways and looked yesterday and today for instructions on how to fill in the function syntax, but nothing worked for me.
If I write it like this: join(map(11.array; “record.question_from_user”); newline)
Then an error appears.
If I write otherwise, it doesn’t pull the text out of the array, at most ‘\n’
I don’t understand what’s wrong and what I’m doing wrong, please tell me.
@Alex23, Array is correctly mapped now (in green). The syntax for the key in map() function is question_from_user with no ’ or object.
But here it’s kinda tricky, because question_from_user is in Record, not directly in Array. Can you try instead of referencing array, click on Record ?
Or use : map(array;Record;question_from_user) ?
instead of “\n”, use newline (the pink function), unless you’re searching for a string called “\n” in the value.
When I provide this, you have to copy and paste the entire line into your field. The {{ }}
brackets convert the double quotes into strings, so you should not see them at all. It also converts the word newline into a special variable.
{{ join(map(11.array; "record.question_from_user"); newline) }}
Hope this helps! Let me know if there are any further questions or issues.
— @samliew
P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.
Thank you @samliew and @kudracha !
The issue was solved in such a way, I have attached a screenshot, it was necessary to take names from Raw and use necessarily ready functions.
But now I have a problem that if a user writes for example his question in two messages, then Telegram responds to his message twice for each of them. How can I make it so that the user gets one answer to his question?
Hey, everybody!
I have a problem persists, I have an aggregator that aggregates a user’s messages into an array in a unit of time and passes it to chatgpt. And it first message passes further to telegram for the user to get a reply. But then on the second message that was in the array also gives the user a reply. And everything is logged as one reply.
What can I do with this and how can I make a user receive one response for a group of his messages?