Skip to main content

Summary of My Flow

  1. An external request that fetches data from a Google Sheets spreadsheet and stores it as a custom field.
  2. An external request that uses the captured data to generate a response with ChatGPT.

Part 1 of my flow is working as shown bewlow
 

 

Part 2 of my flow presents an error when trying to pass the custom field to ChatGPT. I’ve also tested it with a third-party webhook, and it keeps returning ManyChat's internal code (cuf_XXXXX) without actually reading the data.

Setups I already have:

  • The custom field is text.
  • The data is text and is fetched as text from Google Sheets.

Here is my body code for 2nd action (manychat>chatgpt)

 


{
  "model": "gpt-4o",
  "messages": a
    {
      "role": "system",
      "content": "Você é um assistente que gera respostas humanizadas."
    },
    {
      "role": "user",
      "content": "As ações mais próximas do seu preço mínimo no momento são essas dessa lista aqui que exportamos: {{5min}"
    }
  ]
}
 

“5min” is my customfield which I guess is “hardcoded” by manychat as “cuf_12211990”

 

Any suggestions?

Hey, ​@manychatdan!

 

That usually happens when the custom field is empty.

Try going to your “test user” and populate the field with any value to test the request again. 😉


@manychatdan the Response Mapping part is failing in the first step:

 

Make sure that you have the correct setup in the 'Response mapping' part, and that you're saving the $.tickers response to your custom field.

If necessary, add a testing step in between to print the value of the CUF and make sure you are having the proper values.

Also, for testing, you'll need to run this flow from start to end and test the whole thing. If you just do 'Test Request' you'll have incomplete information - unless you set the fields correctly in your profile before testing.


@manychatdan the Response Mapping part is failing in the first step:

 

Make sure that you have the correct setup in the 'Response mapping' part, and that you're saving the $.tickers response to your custom field.

If necessary, add a testing step in between to print the value of the CUF and make sure you are having the proper values.

Also, for testing, you'll need to run this flow from start to end and test the whole thing. If you just do 'Test Request' you'll have incomplete information - unless you set the fields correctly in your profile before testing.

 

Thanks in advance for the support
 

Here is my response mapping setup

 

I’ve ran a test on a third part webhook

 

 

and this is the outcome

 

I’ve tested the whole process, but don’t know what else to do to check if the customfield is getting properly populated


Do something like this to test:

 

You can also set the default value, to make sure you're not overlooking anything:

 

If you can't figure it out, I can offer you a troubleshooting call, I'm sure we can sort this out in a couple minutes! (And we do it in Portuguese if you prefer!)


I’ve tried the test, but still not getting any data

 


Ok ​@manychatdan you've got something setup wrong, External Requests and Mapping work in Manychat, I use this every day (and I haven't seen any bugs on my bots today either).

Happy to do a call if you're up for it. If you need, book it and and send me an email so I can make a slot for you later today (which you won't see available on the booking app because I have my Tuesdays blocked :D).


Gustavo, I really appreciate your help.

I tried running a test from scratch again, now with a simple cell in Google Sheets containing "12345" in any tab.

My script in Google Sheets looks like this

function doGet() {
const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("teste");
const value = sheet.getRange("A1").getValue();
const result = { "valor": value }; // Explicit JSON
return ContentService
.createTextOutput(JSON.stringify(result))
.setMimeType(ContentService.MimeType.JSON);
}

My first external request is setup returning the value "12345" and its response mapping is configured to populate the custom field with the value (in this case, it should be 12345).
 

 

 

At this point, the customfield “5min” should be already populated with “12345”, right?

The thing is the next step (testing via message or third part webhook) already shows that it is not, showing de CUF code (as it was said here it is because has no data in it)

It seems like the responsamapping has a problem


When you run a Test Request, it WILL NOT do the mapping to the custom field.

You have to run it for real (triggering the flow, as a real user would) for all the fields to be setup correctly.

Are you running it, or are you just testing it with the "Test Request" button?


Yep, I tested using my Instagram accounts. I added some text alongside the customfield. It only returns the common text (“Hello”)


Ok, one last test: check in Settings > Logs and see if you find any errors there.

If not, talk to support them so they can take a look.

I've never had issues with External Requests and I'm 99.9% sure there's something missing on your setup… But other than personally debugging your setup, I can't think of any other way to assist you here on the chat. 🤷‍♂️

 


 

No logs :/

Thanks for everything! I’ll reach support and if I get any news I’ll keep the thread updated

I’ve also checked the JSONPath on jsonpath evaluator but everything is fine

 

 

 

 


Reply