How to get the unfilled or filled fields list in a form by a known lead?

durgaprasad
Level 1

How to get the unfilled or filled fields list in a form by a known lead?

Hello Marketo Nation,

 

I am trying to implement custom progressive profiling in our forms. Here is the issue that i am facing and would like your suggestion to resolve it.

 

I am trying to get the unfilled fields by a known lead so that i can display those in the next return visit. I cannot use the lead tokens in the landing page as we cannot expose that information in the page. Is there any API to get the list of filled or unfilled field names without exposing the actual values?

 

i tried using the internal marketo API call ('/index.php/form/getKnownLead?_mkt_trk='+encodeURIComponent(munchkinCookie)+'&form=xxxx&munchkinId=xxx-xxx-xxx&filledFields=false';) but it is only giving Firstname, Lastname and not any other unfilled fields. In the filledFields list also it is not giving the list of filled fields properly. Whatever fields are filled in the first visit are not part of the filledFields list also.

 

Could you please suggest any possible solutions to resolve this.

 

Thanks in advance.

DP

4 REPLIES 4
SanfordWhiteman
Level 10 - Community Moderator

Re: How to get the unfilled or filled fields list in a form by a known lead?

I don't understand why this is different from standard Progressive Profiling - which displays only empty fields (within the ProgPro fieldset) and does not reveal any values.

durgaprasad
Level 1

Re: How to get the unfilled or filled fields list in a form by a known lead?

This is different because the fields are displayed dynamically by reading a custom configuration. The number of fields and order of the fields is as per the configuration and can be configured differently for different forms. Also the fields displayed can be configured differently based on the segment the user belongs to. All the fields will be available in the form and will be hidden initially. The fields will be shown for unknown and known users as per the configuration.

So for known users based on the the configured fields and the no of fields to display at a time i need to display the unfilled fields from the configured fields.

SanfordWhiteman
Level 10 - Community Moderator

Re: How to get the unfilled or filled fields list in a form by a known lead?

You should still base this logic on the native ProgPro. There's no need to rewrite the logic.

 

Add all your fields to the ProgPro block. Then Marketo will only render the unfilled fields — that's taken care of automatically.

 

Hide the form element by default.

 

When the form is ready (you listen for the whenReady event), rearrange the unfilled field rows as necessary and remove those rows which the person should not see at all.

 

Then unhide the form element.

durgaprasad
Level 1

Re: How to get the unfilled or filled fields list in a form by a known lead?

The internal api call ('/index.php/form/getKnownLead?_mkt_trk='+encodeURIComponent(munchkinCookie)+'&form=xxxx&munchkinId=xxx-xxx-xxx&filledFields=true';)  worked fine if the pre fill is enabled on the form fields. Now i am getting the filledFields with the list if all the filled fields properly. So for now i am using this to determine the unfilled fields and show the next unfilled field configured to the known user.