SOLVED

Create a hidden form field via the REST API

Go to solution
Highlighted

Create a hidden form field via the REST API

I'm trying to add a field to a form via the REST API (this will eventually be done to hundreds of forms which is why I want to do it via the API) but I get a System Error when I try to set 'fieldType' to 'hidden'. When I run the 'Get Fields For Form' endpoint I see that 'dataType' is 'hidden' for the hidden fields, is the 'fieldType' declaration different (they seem to match on everything else)?

What I'm trying to run that is giving me the system error (personal data XX'd out).

Endpoint: https://###-###-###.mktorest.com/rest/asset/v1/form/XXXX/fields.json

Post Payload: fieldId=myField__c&label=HiddenFieldLabel&fieldType=hidden&access_token=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX:XX

Also, is there any documentation on how to set the Autofill settings for hidden fields via the API?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Level 10 - Community Moderator

Re: Create a hidden form field via the REST API

It's not you, it's the docs (which are not quite prime-time for these latest endpoints) and the server. This shouldn't cause an error.  I expect hidden hasn't been implemented correctly. Do you want to open a case, or should I?

View solution in original post

15 REPLIES 15
Highlighted
Level 10 - Community Moderator

Re: Create a hidden form field via the REST API

It's not you, it's the docs (which are not quite prime-time for these latest endpoints) and the server. This shouldn't cause an error.  I expect hidden hasn't been implemented correctly. Do you want to open a case, or should I?

View solution in original post

Highlighted
Anonymous
Not applicable

Re: Create a hidden form field via the REST API

Sandy!!!!

How come every time I am looking for information on a question, you are somehow involved with the answer?????????

Highlighted
Level 10 - Community Moderator

Re: Create a hidden form field via the REST API

Because I'm the knowitalliest know-it-all who ever knew it all?

Highlighted

Re: Create a hidden form field via the REST API

He's a celebrity around these parts. Haha.

Highlighted
Anonymous
Not applicable

Re: Create a hidden form field via the REST API

LOL!!!! You seriously made my day today. I want to know something! Anything!!! A penny to your dollar!!

Highlighted
Anonymous
Not applicable

Re: Create a hidden form field via the REST API

Seriously! lol

Highlighted
Anonymous
Not applicable

Re: Create a hidden form field via the REST API

Hi Sanford Whiteman​ Is this fixed now ? We are looking to create form and fields using API ? Can you please help ?

Thanks

Highlighted
Level 10 - Community Moderator

Re: Create a hidden form field via the REST API

I don't know if it's fixed, likely not.

Are you sure you need to use the Asset API to create forms? What's the use case?  This API still falls short of the UI-driven options.

Highlighted
Anonymous
Not applicable

Re: Create a hidden form field via the REST API

Hi Sanford Whiteman

Thanks for your prompt reply. I work in a Uni. There are many content editors, they often need to create forms for various campaigns, events or other things, not everyone has access to Marketo to login and create/setup forms. So we were thinking of a way to give the non-technical editors the capability to create forms using our CMS and then automatically have this data inserted into Marketo.

I know how to push leads into Marketo using API, but we need a solution for a step before. i.e. create from and fields in Marketo using the API.

We can do the frontend/interface ourselves, all we need is an API that let us create forms and specify its fields.