Create rule button disabled on custom rule action

I am working on a web app for custom rule actions. I’ve gotten to the point where I can retrieve the rule form metadata, but the “Create rule” button stays disabled and the form continues to say “Set up this action”. I’ve enabled CORS for https://app.asana.com on my metadata endpoint and the form appears to be loading correctly. There are no errors in the network monitor in Chrome. Here is the metadata I’m using, which is as simple as I can possibly make it, but several other variations don’t work either. What am I missing?

{
	"template": "form_metadata_v0",
	"metadata": {
		"fields": [
			{
				"type": "static_text",
				"id": "1",
				"name": "Static Text",
				"is_required": false,
				"width": "full"
			}
		]
	}
}

Could it be that a rule needs at least one data given through a field? Looks like you have a single not required field…
(Just thinking out loud)

I thought that, too. I’ve tried several other combinations of fields, required and not required, but I still can’t get the button enabled. And I’ve authorized this app to my Asana account. Is there another type of app registration that needs to be performed?

@David_Hess1,

Two things:

In your metadata structure, in addition to fields, I think you’ll also need to supply a title and also on_submit_callback and on_change_callback URLs. See here.

Also, I recommend you use the UI Builder as it’ll help you construct the necessary parameters.

Thank you, Phil. The docs are bit muddy in this area and using the UI builder is what threw me off. It doesn’t indicate the callbacks are required in some of the examples. I assumed the Minimalist example would provide the minimum fields required to make the form work. In my case, I have rules that don’t need to be customized with information from the form. Your help gets me a little further down the road. Thanks gain.

2 Likes