Creating item with dynamic mapping doesn't work

Hi devs,

I’ve created a recipe with dynamic mapping and want to trigger it now. I want to trigger the recipe with data from other software and update monday according to the dynamic values set by the user.

When triggering it, it returns: <Response [200]> - {‘success’: True}’

Although that sounds good, it does not create an item in monday.
I added more screenshots below.

I feel like it has something to do with how I structure the json data that I return to monday. I tried a lot of options, but can’t seem to get it right.

Extra context: for some reason it never calls the field definitions URL. Might also be part of the issue.

Thanks in advance for the help. If anything needs clarification, please let me know.





Hello @patrick7,

This is odd. I tested this with an almost identical context and it worked for me. There might be something I am missing because I do not usually use that language (I am a JS guy).

What is strange is that the /dynamic endpoint is not being called. Are you sure you don’t have a typo somewhere? Do you see your print? (‘dynamic call’)

Also, I am not sure about your available_fields array. Can you try not using quotes for id, title, outboundType and inboundTypes?

This is my function as a reference (js):

app.post("/getFields", function(req, res) {
	console.log("GET FIELDS BEING CALLED", req);
	return res.status(200).send([
		{ id: 'text', title: 'Text', outboundType: ['text', 'numeric'], inboundTypes: ['text', 'numeric', 'empty_value'] },
		{ id: 'number', title: 'Number', outboundType: 'numeric', inboundTypes: ['empty_value', 'numeric'] },
	  ]);
	}
);

Also, not sure if it is relevant in your case, but I am testing using Postman and in the body of my request, if I use a coma after the last value in my object, I get an error. Can you, just in case erase that coma?

This is my body as a reference:

{
  "trigger": {
    "outputFields": { 
      "objectInAnotherPlatform": {
        "number" : 123,
        "text" : "This is my text"
      }
    }
  }
}

Let us know what happens!

Cheers,
Matias

Hi Matias, thanks for your answer.

The /dynamic endpoint does get called. It’s the /definitions endpoint that is not called for some reason. I configured this one in ‘Field Types’ → ‘Field Definitions URL’ field in monday. (See attached screenshot)

Changing the available_fields array as you mentioned causes an error. It’s a Python related error though.

Removing the ‘,’ at the end of the body didn’t make a difference unfortunately.

I’ll keep trying. Let me know if you have any ideas or things you want me to check!

image

Just tested in Postman. Exact same result as in Python.
Do you see, based on my app settings, what I’m not returning correctly?

Maybe you can share your app settings @Matias.Monday so I can copy it and make sure that’s not the issue?

I created a recipe that sends the data back to myself when I call the webhook URL that monday gave me.

So I created a test integration. Monday returned this URL: https://api-gw.monday.com/automations/apps-events/182572812

I set it up in a way that when I send data to this URL, it sends it to another endpoint of me, so I can see what monday received.

It seems like the body doesn’t get passed for some reason

I sent this:

And received this:

It’s weird though. Literally everything I send to the webhook URL return ‘success: true’. Here’s an example:

Not sure if this helps at all with finding out what is going wrong, but thought it was worth sharing

Hello again,

Can you please try one more thing for me? If it doesn’t work, we can jump on a call to see if we can get to the bottom of it.

Can you try, in Postman, using JSON instead of “Text”? (at the top, on the right, next to where it says “GraphQL”).

Wow that worked. Immediately was able to find the problem in the code as well…

I first had:
response = requests.post(url, headers=headers, data=data).json()

And changed it to:
response = requests.post(url, headers=headers, json=data).json()

Very weird though, because I also tried adding :
data = json.dumps(data)
while keeping data=data in the response.
That didn’t work either.

Weird, but I’m very happy it finally works. Thanks a lot!

1 Like

Hello Patrick,

Amazing!

I am very happy it works for you with that change :metal:

Let us know if you need anything else in the future!

1 Like