Slightly different data structure on same webhook : Only the "Determined data structure" variables are accessible

Hi everyone,

I use Mautic to create landing pages with webforms.
I configured a Mautic webhook to send the form data “when a form is submitted”.
Problem : Form results are not exactly the same from one form to another.

  1. I’ve created a scenario with a webhook, sent a test payload (form submission) to the webhook so that Make could determine the data structure. Worked fine.
  2. I’ve extracted the output bundle in JSON
  3. I sent another payload (from another form) and extracted the output bundle
  4. I noticed the data structure is pretty much the same apart of the “results” collection : it contains the fields & values of the form and can vary from one to another.
  5. I gathered all the possible fields that could be sent/received and created a Webhook with a data structure that includes all the fields :
  6. But when I try to access the fields I’ve added, they’re not displayed (even if I had the notice “Refreshing metadata…” after changing the data structure) :

How can I access the added fields ???
How come I have to “determine data structure” from a payload whereas I’ve defined a custom data structure ?
Am I doing something wrong ?

Thanks for your help !!!

Howdy @adpgroup! Welcome to the community.

You can run a “redetermine datastructure” from the webhook module, after assigningly all of your variables down the line in the scenario, running in the case of the slight variation. then assign those variables.

:information_source: You might have to save your scenario, close and re-open it, then hit the “redetermine datastructure” button. that display glitch has been there for several months.

^^aside this is generally pretty useful when troubleshooting the nitty gritty of a scenario.

some variables will show up as a different color based on if they were there in the previous run.
But the scenario should run fine in 90% of cases, with variables listed as “doesn’t exist”

there are some cases where you will need to do this ifempty(variable,null) such as when updating google contacts.

you can also “predict” what a variable format will be,
if you copy and paste any IML value into a text editor, you can see what it looks like as raw text, and then edit it with a different variable name, and paste it back in.

Hope this helps.


Otherwise you might try to use get() and put in the results object and the variable you want to get. In Scenarios where this get’s you nothing, it’s just blank and in the other scenarios you get the variable.

Hope it helps!

1 Like

Hey @JugaadiTech !
Thanks a bunch for your quick answer :pray:
Indeed, I succeeded in assigning the new variables using the method you mentionned:

  1. Select the variable in
    2022-08-04 13_42_34-MAUTIC_ All forms =_ Sheet + Calculateur _ Make

  2. Copy into a text editor:
    2022-08-04 13_44_23-Clipboard

  3. Modify the name:
    2022-08-04 13_45_34-Window

  4. Paste it into the scenario:
    2022-08-04 13_42_34-MAUTIC_ All forms =_ Sheet + Calculateur _ Make2

NB : It does NOT display the new variable name (mynewfield in example), but if I select the variable and copy-paste it into a text editor, it IS set as the new variable.

Hey @Richard_Johannes,
That sounds like a good & quick solution, but as my Data structure can have many fields, I should then assign a new variable to each one of them.

In some of my forms, I have “email” field, and some others, I have “email2”.
I set a variable “email” like this:
2022-08-04 13_51_23-MAUTIC_ All forms =_ Sheet + Calculateur _ Make

Which is nothing more than :
{{ifempty(26.mautic.form_on_submit[]; 26.mautic.form_on_submit[].submission.results.email2)}}