Static samples are generally just hard-coded json. They represent fields that are guaranteed to be present in every response, for every user. Static samples are then used when creating Zap templates, where the author is building field mappings that have to work for everyone. We’ll also use it for validations, like a schema - if we spot your API missing something defined in the sample we’ll show you an error in the dev environment.
So any dynamic, user-specific, fields won’t work. In most cases the user will only interact with the samples returned from your API in your perform. Generally, users will only interact with the static sample if they cancel the test step in the editor.
Thank you so much for the response @Zane . If that’s the case, I wonder how fully dynamic triggers such as New Spreadsheet Row in Google Sheets would work where the data format completely depends on the columns of the spreadsheet selected by the user at the time of setup? That’s the functionality I am trying to implement.
Some of our highly dynamic apps (say, form apps) have very thin static samples for some triggers and/or actions. Like, an id, name, timestamp may be the only universally included elements, so that’s all that’s in the static sample. The user experience in the editor is really based on the live samples you bring back, so this is ok.
Really insightful question. Certainly something I’ll note that we need to spend more time on as we rework our docs.
Best advice, generally, is to configure and run Zaps with your integration in the Zap editor like a user would, watch your logs and task history, and you’ll get a better sense of how what you’re building is getting used, and validate that you’re producing a good experience for your users.
Thank you so much for the response @Zane . I totally agree with you
The user experience in the editor is really based on the live samples you bring back
In my opinion, most of the time, if not always, when the API is not reachable (or when the user chooses not to test their Trigger), the static template wouldn’t add much value to the user. I personally found them a bit redundant and confusing to be honest. I believe they are only useful when they are 100% matched with the actual schema which is not the case for applications with dynamic nature such as forms.
Once again, thanks a lot for the quick response.
That said, static samples are really important for reasons beyond the immediate user experience in the editor. We require them for integrations to get published in the app directory. For others reading this, please be thoughtful about your static samples - the effort will pay off for Zap sharing, validation support and other operations.