0

Trying to parse json object using Logic App and Select(Data Operation) Action - and passing dynamic json of sharepoint list columns inside [MAP] field to get those particular columns from sharepoint list and performing for each sharepoint list.

MAP field working fine when I am passing json object hardcoded way as mentioned below and giving expected results:

{
    "Approval": "@{item()?['Approved']}",
    "Approved By": "@{item()['Approved_x0020_By']['DisplayName']}",
    "Beer Product": "@{item()['Coke_x0020_Product']['Value']}"
}

But When same value passing using Dynamic Expression in MAP field output obtained from parse_JSON: results are not coming as expected Please find attached screen short.

Skin
  • 9,085
  • 2
  • 13
  • 29

1 Answers1

0

I have reproduced the issue and got the expected result by following below steps-

Flow Diagram

enter image description here

Here I am using the dynamic expression of the output obtained from Parse_JSON in the Map field like below

enter image description here

Code View

{ 
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"Parse_JSON": {
"inputs": {
"content": "@triggerBody()",
"schema": {
"items": {
"properties": {
"details": {
"properties": {
"age": {
"type": "integer"
},
"city": {
"type": "string"
}
},
"type": "object"
},
"id": {
"type": "integer"
},
"name": {
"type": "string"
}
},
"required": [
"id",
"name",
"details"
],
"type": "object"
},
"type": "array"
}
},
"runAfter": {},
"type": "ParseJson"
},
"Select": {
"inputs": {
"from": "@body('Parse_JSON')",
"select": {
"Age": "@item()?['details']?['age']",
"City": "@item()?['details']?['city']",
"Id": "@item()['id']",
"Name": "@item()['name']"
}
},
"runAfter": {
"Parse_JSON": [
"Succeeded"
]
},
"type": "Select"
}
},
"contentVersion": "1.0.0.0",
"outputs": {},
"parameters": {},
"triggers": {
"manual": {
"inputs": {
"schema": {
"items": {
"properties": {
"details": {
"properties": {
"age": {
"type": "integer"
},
"city": {
"type": "string"
}
},
"type": "object"
},
"id": {
"type": "integer"
},
"name": {
"type": "string"
}
},
"required": [
"id",
"name",
"details"
],
"type": "object"
},
"type": "array"
}
},
"kind": "Http",
"type": "Request"
}
}
},
"parameters": {}
}

Output:

enter image description here

Ikhtesam Afrin
  • 897
  • 1
  • 1
  • 6
  • Thanks for your efforts the solution which you have provided here you manually added the column name and its associated value (Key-Value mode) in Map section of SELECT Action but instead I want to pass JSON string dynamically over there if you see there is another option to switch into text mode. – G KAMESWAR RAO Aug 20 '23 at 07:25
  • Please share an example of your expected input and output format and what error you are getting? It will be easier to help you better with these information – Ikhtesam Afrin Aug 20 '23 at 09:22