Get value out of the Vars type

Hey short question regarding Workflows. I send Formdata to my Workflow via Integration Endpoint. After reading the data, my Variable regData looks like this:
“regData”: {
“adresse”: {
@value”: “Musterstraße 12, 12345 Musterstadt”,
@type”: “String”
},
“country”: {
@value”: “DE”,
@type”: “String”
},
“dynastieName”: {
@value”: “Test Systems”,
@type”: “String”
},
“ecoId”: {
@value”: “DE-1234567”,
@type”: “String”
},
“foundingDate”: {
@value”: “2020-05-18”,
@type”: “String”
},
“orgaName”: {
@value”: “Test GmbH”,
@type”: “String”
},
“plz”: {
@value”: “12345”,
@type”: “String”
},
“rechtsform”: {
@value”: “GmbH”,
@type”: “String”
},
“sector”: {
@value”: “IT-Services”,
@type”: “String”
},
“steuerId”: {
@value”: “123/456/78901”,
@type”: “String”
},
“ustId”: {
@value”: “DE123456789”,
@type”: “String”
}
},

How am I able to take the value of e.g. country and assign it to a variable. regData.country results in empty object, regData.country.value gives an error.

What am I missing here?

Did you manage to figure it out? I would have to see an example workflow to try it and see.
Because im not sure how you read the data and what kinds of expressions you have.

Hey :slight_smile:

I did not but it is no blocker for me either.
This is my workflow:

createcompany (19).zip (4.2 KB)

Here in the step “Var to Vars” I receive all the Formdata Fields from my Integration Gateway Request. I can use them to create new Entrys (so no blocker) but I would lke to know, why I cannot “unpack” them, so that I can get rid of this whole “@values” and “@types” stuff…

Furthermore I just added an Error Handler the first time which is another issue for me. If you want you can answer that too, if not I will post a new Issue here in the Forum.
The Error Handler should take the Error Message, Step ID and so on and propagate them into the accessible Vars in the catch Branch. So my Expression (step 263) should be able to access them. But I just get Errors like:

{
    "error": {
        "message": "could not exec workflow: workflow 458417723324366849 step 263 execution failed: expression \"{\\n\\\"status\\\": \\\"error\\\",\\n\\\"error\\\": customErrorMessage\\n}\" failed: failed to select 'customErrorMessage' on *expr.Vars: no such key 'customErrorMessage'"
    }
}

(To check this whole Error Handler Topic I build in a mistake into step 36. You can fix it by removing the “123” in the scope)

Thanks for the support :smiley:

I think this is an issue with how Corteza encodes its values when sending them over integration gateway.
I created an issue for this here

You could use the “Process arbitrary data in jsenv” to process the regData in the meanwhile

Regarding the error handler, i cant reproduce your behavior. For me it correctly gets the customErrorMessage.

Here is a minimum reproduction workflow
Error handler.zip (1.1 KB)