skip to Main Content

Parsed Message
{
"date": "2022-02-04",
"customerID": 123,
"customerInfo": {
"id": 123,
"lastname": "Smith",
"firstname": "David",
"email": "[email protected]",
},
"currency": "EUR"
}

I would like to remove the customerInfo section so the JSON looks like.
{
"date": "2022-02-04",
"customerID": 123,
"currency": "EUR"
}

How would one do this in the LogicApp. I tried remove property but could not get that working. Any suggestions would be appreciated.

2

Answers


  1. You just initialize new variable from that one and populate it

    "Initialize_variable": {
          "type": "InitializeVariable",
          "inputs": {
             "variables": [ {
                   "name": "sensitisedMessage",
                   "type": "Object",
                   "value":  { "date": @message['date'], "customerID": @message['customerID'], "currency": "@message['currency']" }
              } ]
          },
          "runAfter": {}
       }
    

    I have not checked the format of the json in an actual logic app, but you get the idea

    Login or Signup to reply.
  2. I have reproduced in my environment and removed customer info using remove property as below :

    Firstly, I have initialized a variable as below:

    enter image description here

    Then I used compose operation as below:
    In compose input: removeProperty(variables('emo'),'customerInfo')
    enter image description here

    Then i have set the variable with output of compose as below:
    enter image description here

    Output:

    enter image description here

    enter image description here

    enter image description here

    enter image description here

    Try to follow above process you will get to remove customerInfo as mine got.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search