Unexpected behaviour if error in outbound

I am not sure if it’s expected behaviour but I have had two issues in the oubound configuration e.g. once had “exec” instead of “expr” and it worked but in that particular field of the payload, instead of having the value of the variable I was trying to get from the submitted form, I was getting the whole document injected.

I was only later aware when the mediation was not working anymore :thinking:

Hi @magp18

I’m afraid we need more details about your config, what is working and what is not. exec is not a property that is used in outbound, expr is.

Hi @diana
Yes, I don’t have any issues now, maybe I didn’t clarify enough in the post sorry for that. The post was supposed to be just for information in case anyone sees it in the payload or in case it’s not expected behaviour

I just wanted to let you know that when you have an error in your configuration of your outbound e.g. like you said exec is not a property but if you have it (we had it as a typo) then it will not fail, it will inject the whole doc in that field of the payload.

For example if you have

"properties.d_urti": {
          "exec": "doc.form === 'form_id' ? doc.fields.d_urti : doc.fields.inputs.data_d_urti"
},

Like we mistakenly had, it will not fail, but in the payload where it should be

"properties": {
    "d_urti": "0"
}

(The field can be 0 or 1)
it will be sent as

"properties": {
    "d_urti": {
          "doc": {the whole document}
}

And it can be any type of mistake, I think I had “report.is_closed”: true also injecting the whole document (I think it was expecting a string and not a boolean)

Hi @magp18 this is a bug where if the mapping function doesn’t know what to do, it inlcudes the entire document. I have added an issue, for now the workaround can be to check that the config uses “expr” instead of anything else and double check the payload.

1 Like