Issue with from_dataset() formula when calling schema via REST API

I have a schema that works fine if I use the Mockaroo UI and download to CSV, JSON, whatever. But when I call the Schema using REST API, any fields using from_dataset() return an error string of “error: Could not access blank value: Use || to provide a default value for blank fields. Example: (my_field || 0) + 1” All the other fields defined in the Schema are returned correctly in the JSON response. Any ideas?

Interesting… are you sure you’re using the API key associated with your account? If not, it might be a permissions issue. If you are I’ll need to dig a little deeper.

I’m definitely using my api key. I’ve validated this on both this Mockaroo site and the heroku version that Salesforce has internally.

Here is simple schema I have. https://www.mockaroo.com/77adca10

If I don’t include the API key in the REST request, I get following error that cannot even get to my Schema

{“error”:“API Key required. Please make sure to specify ?key=(your api key) in the url.”}

Yep, there was a bug in the from_dataset implementation. It should now be fixed. Thank you for reporting it!

Very nice! Thanks for the quick fix on this.