Skip to content
Trouble mapping Dus...
 
Notifications
Clear all

Trouble mapping Dust AI response in Telegram Bot module

7 Posts
2 Users
0 Reactions
5 Views
Nathan4
(@nathan4)
Posts: 4
Active Member
Topic starter
 

Hello everyone,

I'm encountering a challenge with mapping the response from Dust AI within the "Send a Text Message" module for Telegram in callin.io.

My scenario's context:

  1. Telegram Bot - Watch Updates → Captures the user's message and Chat ID.
  2. Dust AI - Talk to an Assistant → Processes the user's message and generates a response.
  3. Telegram Bot - Send a Message → Sends the generated response back to the user.

The issue:

  • The response from Dust AI is located within "content" in Array 1 of the output.
  • However, when I attempt to map this response in the Telegram module, I cannot locate the appropriate field.
  • Previously, I utilized the AI assistant to configure this automatically, and it functioned correctly. But I had to delete and re-establish my scenario, and now the AI assistant is no longer performing this task.

What I need assistance with:

  • How can I manually locate and correctly map Dust AI's response (the content from Array 1) into the Telegram "Send a Message" module?
  • Is there a specific function or transformation I should employ in callin.io to extract the correct response?

Any guidance would be greatly appreciated. Thank you in advance.

 
Posted : 07/02/2025 11:16 am
Benjamin_from_Make
(@benjamin_from_make)
Posts: 35
Eminent Member
 

Hello,

It appears that Dust AI is returning an array of arrays for Content.

:sweat_smile:

For this particular screenshot, the actual Content you need to return to the user seems to be within the first item of the second item of Content.

:brain:

If the structure is consistently the same, you can simply map Content.Content. callin.io will automatically add square brackets.

In the first set of brackets, you can enter 2, and in the second set, enter 1 (or leave it as the default, which is also 1).

This will prompt the mapping to select "content" from the second item of the "Content" array, then the first collection from the resulting array, and finally the desired 'content' field.

If there aren't always exactly 2 items, or if the result sometimes needs to be picked from a different item, you'll require additional logic. You might be able to utilize the "map" function, but for that, you'll need to identify a field that distinguishes the items within this array.

If you're unable to resolve this, could you please extract a few results from Dust AI and share them here so we can take a look?

Benjamin

 
Posted : 10/02/2025 7:55 am
Nathan4
(@nathan4)
Posts: 4
Active Member
Topic starter
 

Hey Benjamin,

Thank you so much for your assistance.

:slight_smile:

It worked great.

 
Posted : 10/02/2025 10:30 am
Nathan4
(@nathan4)
Posts: 4
Active Member
Topic starter
 

Hi there,

Could you perhaps explain how to automatically retrieve the correct array using the mapping method? When I attempt this, the colors appear black, and it doesn't seem to connect with the desired output, if that makes sense?

 
Posted : 10/02/2025 3:23 pm
Benjamin_from_Make
(@benjamin_from_make)
Posts: 35
Eminent Member
 

The map function enables you to extract a field from a complex array and return a new, simpler array. It also allows you to pinpoint a specific item by searching one of its fields. Since it returns a new array, you'll need to extract the first element from the map output using a function like "first".

To illustrate, I've created a scenario with an example involving an array of "companies". Each company contains an array of "contacts", and each contact has a grade (A, B, C, D).

This example demonstrates how to retrieve the contacts for the company named "Hooli" and then find the name of the contact with Grade=C within that company. I've also included a final example that combines searching for the company with searching for the contact.

Import this blueprint from a new scenario:
map-example.json (16.9 KB)

If it remains unclear, try exporting an example output from Dust AI and specify what information needs to be retrieved. You mentioned "content", but what other field could be used to identify the item you wish to extract?

I hope my explanation is clear, though it's a bit challenging to convey through text alone.

:sweat_smile:

:sweat_smile:

 
Posted : 10/02/2025 3:49 pm
Nathan4
(@nathan4)
Posts: 4
Active Member
Topic starter
 

Would it be possible for me to send you an email? Perhaps with a Loom video, it might be simpler.

 
Posted : 10/02/2025 4:34 pm
Benjamin_from_Make
(@benjamin_from_make)
Posts: 35
Eminent Member
 

Apologies, I missed your message. I've sent you a direct message now.

Ben

 
Posted : 11/02/2025 3:23 pm
Share: