LogicAppsUX icon indicating copy to clipboard operation
LogicAppsUX copied to clipboard

Nested conditional is not deserialized correctly

Open chris-w-dev opened this issue 1 year ago • 0 comments

Describe the Bug with repro steps

There are a couple of scenarios for an If function where a map definition can be created, saved, and an XSLT can be generated correctly as long as the designer is not closed. When the designer is closed and reopened for such a map definition, it either cannot be loaded at all (black screen) or different nodes and edges are missing.

  1. If on a property nested in a conditional object does not show up in the designer.
$version: 1
$input: JSON
$output: JSON
$sourceSchema: schema.json
$targetSchema: schema.json
root:
  $if(/root/OrderNo):
    Object1:
      $if(/root/salesOrg):
        String1: /root/Object1/String1

Before:

nested-if-before

After reloading:

nested-if-after

  1. Same scenario as 1 with a function in the nested If results in a black screen.
$version: 1
$input: JSON
$output: JSON
$sourceSchema: schema.json
$targetSchema: schema.json
root:
  $if(/root/OrderNo):
    Object1:
      $if(/root/salesOrg):
        String1: lower-case(/root/Object1/String1)

Before:

nested-if-function-before

  1. If with a function as value nested in a For renders the function incorrectly as a string
$version: 1
$input: JSON
$output: JSON
$sourceSchema: schema.json
$targetSchema: schema.json
root:
  ComplexArray1:
    $for(/root/Nums/*):
      $if(Num):
        F1: multiply(Num, 2)

Before:

if-function-in-for-before

After reloading:

if-function-in-for-after

  1. Same scenario as 3 with an index reference instead of a function, which renders the index also incorrectly as a string
$version: 1
$input: JSON
$output: JSON
$sourceSchema: schema.json
$targetSchema: schema.json
root:
  ComplexArray1:
    $for(/root/Nums/*, $a):
      $if(Num):
        F1: $a

Before:

if-index-in-for-before

After reloading:

if-index-in-for-after

Schema:

{
    "type": "object",
    "properties": {
        "OrderNo": {
            "type": "string"
        },
        "salesOrg": {
            "type": "string"
        },
        "Object1": {
            "type": "object",
            "properties": {
                "String1": {
                    "type": "string"
                }
            }
        },
        "Nums": {
            "type": "array",
            "items": [
                {
                    "type": "object",
                    "properties": {
                        "Num": {
                            "type": "integer"
                        }
                    }
                }
            ]
        },
        "ComplexArray1": {
            "type": "array",
            "items": [
                {
                    "type": "object",
                    "properties": {
                        "F1": {
                            "type": "integer"
                        }
                    }
                }
            ]
        }
    }
}

Screenshots or Videos

No response

Version

v2.119.4

Additional context

No response

chris-w-dev avatar Mar 11 '24 19:03 chris-w-dev