Custom mapping modal crashes tab

Hey devs!
I’m building an app that uses custom field mappings, but I’m experiencing a browser hang/crash.

I have an app where in the recipe, the user is given a dynamic list of items as a response from my server, and based on what was selected from that list, will be presented with a custom mapper modal.

I’m experiencing two things:

  1. In the very simple case where there is just one field to map, the modal is presented and doesn’t crash, but the textfield isn’t populated with the mapping choice I made, it just looks empty. The system seems to be mapping it though, because I can click done and when the automation runs, I get the value that was mapped.

  2. In the more complex case where there are 5+ items to map, the modal opens and the loading gif is shown, but my browser hangs and crashes my browser tab.

The fact that the simple case is working gives me hope that I have the payload structure correct, but I’m not sure where to go from here, or what more information I can give to help diagnose.

Thanks!

would you be willing to post the responses that work and don’t work? with anything like field names replaced.

1 Like

Good place to start. So the simple case with just a single field to map is:

[
	{
		"id": "pulse.project_owner",
		"title": "pulse project_owner",
		"outboundType": "text",
		"inboundTypes": [
			"text"
		]
	}
]

This is the one I’ve seen semi-working.

The more complex case that hangs has 4 parameters to map:

[
	{
		"id": "pulse.name",
		"title": "pulse name",
		"outboundType": "text",
		"inboundTypes": [
			"text"
		]
	},
	{
		"id": "pulse.text_1",
		"title": "pulse text_1",
		"outboundType": "text",
		"inboundTypes": [
			"text"
		]
	},
	{
		"id": "pulse.text8",
		"title": "pulse text8",
		"outboundType": "text",
		"inboundTypes": [
			"text"
		]
	},
	{
		"id": "pulse.name",
		"title": "pulse name",
		"outboundType": "text",
		"inboundTypes": [
			"text"
		]
	}
]

The dot in the id may be breaking it because those are going to be turned into object keys for the mapping object where a dot wouldn’t be permissible.

Also just confirm the content-type is application/json on the response. Simple, but something I sometimes see get overlooked.

2 Likes

Jeez @codyfrisch you know your stuff.

So the dot in the field ID fixed the issue of the text not rendering in the modal, and inspired me to check other things.

Then I discovered: I’m returning fields with the same ID twice- there’s two pulse name and thats causing the form to crash!

Deduping that seems to have fixed it!

1 Like

I missed the duplicate! But then again, its not something I’d have even thought about because… why would you include the same field twice (just from a logic perspective).

My assumption is name you were adding once manually, and then were creating a list of columns using board{columnds{id,title}} which returns name as a column as well (even though you can’t query the name as a column… stupid!). At least that’s what my intuition tells me. If thats the case, you may not need to worry about deduplication code, just not add name manually to the list. (you won’t get duplicates from querying the boards columns, at least ids)

1 Like

It’s even dumber than that really, the payload I was returning was a hand-edited example one- so it ended up being a copypasta issue.

Thanks for the help!