Re: Mass-Updating Forms

Kim_Wieczner
Level 3

Mass-Updating Forms

We are in the process of adding fields to many (and soon to be all) of our forms. We have come across this article​ about making this update in bulk via the API. Does anyone have experience with this?

  1. Are we able to append fields to existing forms using the update endpoint referenced here(http://developers.marketo.com/rest-api/assets/forms/#create_and_update): POST /rest/asset/v1/form/736.json?name=updated name&description=This is a test for update api&language=English&progressiveProfiling=true&locale=en_US
  2. How is existing form logic handled when updating a form? i.e. layers of visibility rules and progressive profiling
  3. How can we mass export all approved form names with their ID numbers?
  4. Is it possible to update all of the Marketo landing pages where these forms live at the same time?
  5. Is it possible to see what non-Marketo pages are using our forms?

Any/all help is appreciated. Thanks!

Kim Burditt
10 REPLIES 10
SanfordWhiteman
Level 10 - Community Moderator

Re: Mass-Updating Forms

Are we able to append fields to existing forms using the update endpoint

You add with the /fields.json endpoint.

How is existing form logic handled when updating a form? i.e. layers of visibility rules and progressive profiling

There's an endpoint for VRs, /visibility.json. ProgPro is considered a pseudo-field in itself.

You can learn a lot more by reverse-engineering forms. The methods are not all totally clear from the docs (though, to be fair it, it's one of the most complete doc sections on the Developer site -- it's just really complex).

How can we mass export all approved form names with their ID numbers?

The main /forms.json endpoint.

Is it possible to update all of the Marketo landing pages where these forms live at the same time?

Approving LP Templates and LPs is done via those other endpoints, not the Forms endpoints.

Is it possible to see what non-Marketo pages are using our forms?

No, not if you haven't already set up some kind of auditing process (i.e. using the Munchkin API to send an activity to Marketo when a form is loaded).

Kim_Wieczner
Level 3

Re: Mass-Updating Forms

Thank you, Sanford! We'll take a look through all of this.

Kim Burditt
Victor_Herrero
Level 5

Re: Mass-Updating Forms

Hi Sanford,

I'm very interested in two of the answers:

Are we able to append fields to existing forms using the update endpoint

You add with the /fields.json endpoint.

Say we have a case of "Episode II: The GDPR Strikes Back" and we need to modify ALL forms with an additional checkbox... It's possible to mass modify all forms with this same modification via API? (If yes, I wish I had known and I really need to look into becoming a developer)
I imagine that this would also be a case of "With great power comes great responsibility" since you could also break all of your forms in one fell swoop, which would bring me to another question:

Could you export all of your form's current settings / setup as a backup?

Is it possible to see what non-Marketo pages are using our forms?

No, not if you haven't already set up some kind of auditing process (i.e. using the Munchkin API to send an activity to Marketo when a form is loaded).

This a very interesting setup, could you share a little more information on this?

I'm a total stranger to the API world, but I feel like I should get to know it better.

Currently we are in the process of "spring cleaning" (#globalwarming) and would like to inventory all of our assets to determine which ones are currently active.

With landing pages we could run reports, but with forms I'm not sure about how to determine the ones currently in use, so I suggested we (and by we I mean them, our developers) build something like a web crawler that looks for all embedded forms (since this seem to be a preferred method for injecting them) in our website and lists at least their form ID.

Your solution seems to work by sending something like a "heartbeat" for every form right? How are you collecting and reporting on that? 

Thanks!

SanfordWhiteman
Level 10 - Community Moderator

Re: Mass-Updating Forms

Say we have a case of "Episode II: The GDPR Strikes Back" and we need to modify ALL forms with an additional checkbox...

Episode V tho.

It's possible to mass modify all forms with this same modification via API?

Yes, but it's certainly not worth learning the Forms REST Asset API for this. It would be easier to add the field using the Forms JS API (in the browser). Even so, how many forms do you have?  This is a good reason to have < 10 global forms, or centralize your forms starting now.

I imagine that this would also be a case of "With great power comes great responsibility" since you could also break all of your forms in one fell swoop

Absolutely.

Could you export all of your form's current settings / setup as a backup?

Unfortunately, not completely. There are still some parts of the form descriptor (the final version parsed in the browser) which are not exposed via REST Asset API.

Your solution seems to work by sending something like a "heartbeat" for every form right? How are you collecting and reporting on that?

Right. A synthetic Visits Web Page event to be exact. Then run a Web Page Activity report.

Floyd_Alvares2
Level 8

Re: Mass-Updating Forms

Hey Sanford.

For "Is it possible to see what non-Marketo pages are using our forms?", if you are looking to see where the forms are situated on  your hosted pages. Is it not possible to run a scan of the html for the marketo form id? Just checking

Of course this would not work for the pages that you are not hosting - such as a 3 party website etc.

Just my thoughts

Floyd

SanfordWhiteman
Level 10 - Community Moderator

Re: Mass-Updating Forms

For Marketo LPs, you can check Used By.

For non-Marketo pages you need the method above.

Victor_Herrero
Level 5

Re: Mass-Updating Forms

Say we have a case of "Episode II: The GDPR Strikes Back" and we need to modify ALL forms with an additional checkbox...

Episode V tho.

Haha, yes, sorry I meant "the first, second movie" that was released. I guess the fact that they started with the fourth movie confused me for life...

It's possible to mass modify all forms with this same modification via API?

Yes, but it's certainly not worth learning the Forms REST Asset API for this. It would be easier to add the field using the Forms JS API (in the browser). Even so, how many forms do you have?  This is a good reason to have < 10 global forms, or centralize your forms starting now.

So, learning how to use REST Asset API for this is a worse investment than doing Forms JS API with a reduced number of global forms?
Yes, I would love to use less forms, but at the moment we have way more than 10... We are in the process of cleaning assets as I said.

I take it you mean by using JS, you can transform your global forms into any other form you need by hiding or showing what is asked (how do you handle different "mandatory field" requests like this?), giving them different shapes according to the situation. Are you also using a "dynamic label" solution for this? I mean changing labels according to country using something like a translation file.

The advantage of JS API would also be that you are "reading" and not "writing"? So you are chosing to show or hide something on the fly, but not actually modifying the base form?

I'm unfamiliar with this method, could you share a resource to check out?

Your solution seems to work by sending something like a "heartbeat" for every form right? How are you collecting and reporting on that?

Right. A synthetic Visits Web Page event to be exact. Then run a Web Page Activity report.

I'm also unfamiliar with this. I know how to pull a Page activity report, but what is a synthetic "visit web page" event mean? Did you tweak that event (unfamiliar with "events" in Marketo I have a very high level understanding of this concept in general: a specific circumstance you can somehow listen to and trigger actions from once it happens) so that it shows form id on the report? Or you tweaked the report?

You said you are using the Munchkin API to generate an activity on people's logs showing the form that was loaded?

SanfordWhiteman
Level 10 - Community Moderator

Re: Mass-Updating Forms

So, learning how to use REST Asset API for this is a worse investment than doing Forms JS API with a reduced number of global forms?

Yes.

Admittedly, if you're not a developer, both will be nearly impossible. But I wouldn't waste time on the REST API for this, and I am a developer!

Are you also using a "dynamic label" solution for this? I mean changing labels according to country using something like a translation file.

Yes.

The advantage of JS API would also be that you are "reading" and not "writing"? So you are chosing to show or hide something on the fly, but not actually modifying the base form?

Yes.

I'm also unfamiliar with this. I know how to pull a Page activity report, but what is a synthetic "visit web page" event mean?

It means using the Munchkin API's munchkinFunction method to send a customized Visits Web Page activity, with a synthetic page URL like /formLoadLogger/123657 (where 123657 is the form ID).

You can then do a report on the pages visited that start with /formLoadLogger/.

Naturally you need to embed this function call in your form embed, i.e. in a Rich Text area, since you're trying to find sites that have just the embed code running.

Lauren_Lord
Level 2

Re: Mass-Updating Forms

Sanford Whiteman

I'm having this similar problem of mass needing to update forms (need to switch out an old field for a new one)- which I think I have found the solution above, so thanks everyone. 

However, my question now is... 

Is there a simple/ mass way to update all campaign flow steps that use the old field, to the new field?

For example... 

Right now we ask for Job Title, but need to switch to a new field we have created call Job Function. We have workflows based on whether people indicate a certain Job Title, which will now need to change to Job Function in order to operate correctly. 

Is there an easy way to a) identify which flows use this old field and b) update them to the new one?

Look forward to your help, thanks!