Skip to content

Conversation

@matyascimbulka
Copy link
Contributor

Links to #101.

This PR introduces support for the new input schema editor schemaBased. Due to the limitation of the Zapier platform the nested input fields are only available for objects. Arrays still use text area input for directly writing the JSON string.

The new input looks like this:
Screenshot 2025-10-09 at 9 29 16

package.json Outdated
{
"name": "apify-zapier-integration",
"version": "4.4.3",
"version": "4.5.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You do not need to commit version changes as it is updated based on created release.

} catch (err) {
throw new Error(`${title} is not a valid JSON, please check it. Error: ${err.message}`);
}
case 'schemaBased':
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I have field like

"arrayObjectsSchemaBased": {
      "title": "Request headers",
      "type": "array",
      "description": "Multiple objects via schemaBased.",
      "editor": "schemaBased",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "title": "Header name",
            "type": "string",
            "description": "Name of HTTP header.",
            "editor": "textfield",
            "minLength": 1
          },
          "value": {
            "title": "Header value",
            "type": "string",
            "description": "Value of header.",
            "editor": "textfield",
            "minLength": 1
          }
        },
        "required": ["name", "value"],
      },
      "minItems": 1,
      "maxItems": 10
    }

It does not work it not show the text area to input json.
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why but title is not propagated into Zapier, input field

"objectSchemaBased": {
      "title": "Advanced configuration",
      "type": "object",
      "description": "Object with defined sub-schema.",
      "editor": "schemaBased",
      "properties": {
        "timeout": {
          "title": "Timeout",
          "type": "integer",
          "description": "Timeout in seconds.",
          "editor": "number",
          "minimum": 1,
          "maximum": 300
        },
        "locale": {
          "title": "Locale",
          "type": "string",
          "description": "Locale string.",
          "editor": "textfield",
          "pattern": "^[a-z]{2,3}-[A-Z]{2}$"
        },
        "debugMode": {
          "title": "Debug Mode",
          "type": "boolean",
          "description": "Enable verbose logging.",
          "editor": "checkbox"
        }
      },
      "required": ["timeout", "locale"],
    },
image

@matyascimbulka
Copy link
Contributor Author

@drobnikj thanks for the review. I have fixed the issue with arrays having editor: schemaBased not showing up properly.

Not sure why but title is not propagated into Zapier, input field

I think this is a bug in Zapier as it uses the key property rather then the label property. I was able to hack a solution to use the title property form input schema as the key. So now it looks like this:
Screenshot 2025-10-13 at 10 30 53

@matyascimbulka matyascimbulka self-assigned this Oct 13, 2025
@drobnikj
Copy link
Member

I think this is a bug in Zapier as it uses the key property rather then the label property.

Can you please report it here?
https://github.com/zapier/zapier-platform

Copy link
Member

@drobnikj drobnikj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks it works now, can you check last comments

getActorAdditionalFields,
maybeGetInputSchemaFromActor,
prefixInputFieldKey,
prefixInputFieldKey, slugifyText,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
prefixInputFieldKey, slugifyText,
prefixInputFieldKey,
slugifyText,

inputSchemaKeys.forEach((key) => {
const fieldKey = prefixInputFieldKey(key);
const value = bundle.inputData[fieldKey];
const fieldTitle = prefixInputFieldKey(slugifyText(inputSchema.properties[key].title));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please comment this workaround and ideally reference the issue you created in Zapier repo about it?

@matyascimbulka
Copy link
Contributor Author

Bug reported to Zapier: zapier/zapier-platform#1178

Copy link
Contributor

@protoss70 protoss70 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found this one issue where when I have 2 schemaBased editors and only the first one shows for me on the screen. I am attaching 2 pictures one from Zapier and one from the console and on Zapier they look like they are grouped together. I am also attaching a gist file of my input schema https://gist.github.com/protoss70/d13f112299e5b2c5e0b12d76c6843885.

The schema is built by @mfori
CONSOLE
screencapture-console-securitybyobscurity-apify-admin-users-tl5mqrG4d7QiRnEpG-actors-IiJZZKxIh4Gu3gxwu-source-2025-10-14-17_12_17

ZAPIER UI
Screenshot 2025-10-14 at 17 10 50

@matyascimbulka
Copy link
Contributor Author

@protoss70 Thank you for the review. I have made some changes to the implementation and tested it against the schema you provided. It should now work as we expect.

Copy link
Member

@drobnikj drobnikj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes looks good to go, I just realize that we need to cover new editor in tests.
Could you please add some test case in https://github.com/apify/apify-zapier-integration/blob/master/test/helpers/index.js

@matyascimbulka
Copy link
Contributor Author

That's a good point. I'll figure out some tests to cover all of this functionality.

matyascimbulka and others added 4 commits October 17, 2025 10:59
* refactor: Make sure all Actor mentions have uppercase A

* fix: Fix input generation for multi-select enums
@matyascimbulka
Copy link
Contributor Author

I have added a few test. Since I'm not sure that any of our public Actors are using this editor yet. I have implemented all of the tests using mocks.

Copy link
Member

@drobnikj drobnikj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks there some unrelated changes like change log, not sure why.
Otherwise ok.

@matyascimbulka matyascimbulka merged commit 43343fe into master Oct 20, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants