Azure / LogicAppsUX

https://learn.microsoft.com/azure/logic-apps
MIT License
73 stars 78 forks source link

Conditional Mapping in array doesn't filter node currectly #3770

Open davephelps opened 9 months ago

davephelps commented 9 months ago

Describe the Bug with repro steps

I have a structure on the input where RFFLoop1 repeats:

<ns0:RFFLoop1>
    <ns0:RFF>
      <ns0:C506>
        <C50601>ADJ</C50601>
        <C50602>RMLGB</C50602>
      </ns0:C506>
    </ns0:RFF>
  </ns0:RFFLoop1>
  <ns0:RFFLoop1>
    <ns0:RFF>
      <ns0:C506>
        <C50601>CN</C50601>
        <C50602>0463903000</C50602>
      </ns0:C506>
    </ns0:RFF>
  </ns0:RFFLoop1>

I want to map the C50602 value but only if the C50601 value equals “CN”. So, I created this map:

image

The condition is written to the yaml and xslt as an “if”, but then proceeds to copy (and concatenate) all nodes regardless of the condition, as you can see from the yaml:

mstns:root:

mstns:header:

$if(is-equal(/ns0:EFACT_D01A_IFTMIN/ns0:RFFLoop1/ns0:RFF/ns0:C506/C50601, "CN")):

mstns:accountnumber: /ns0:EFACT_D01A_IFTMIN/ns0:RFFLoop1/ns0:RFF/ns0:C506/C50602

and the XSLT:

{/ns0:EFACT_D01A_IFTMIN/ns0:RFFLoop1/ns0:RFF/ns0:C506/C50602}

There will only be one RFFLoop1 where the C50601 equals “CN”, so I would expect just the one matching value to appear. Am I doing something wrong or is this a bug? It will be a very common requirement to only copy one value if another value is true.

The existing Logic Apps mapper in the integration account would map this as:

image

This generates the following output, as expected.

0463903000

Screenshots or Videos

No response

Version

2.75

Additional context

No response

AB#25998438

DanielleCogs commented 8 months ago

image Proposed solution would look similar to this- need to make some serialization changes on the frontend to account for this

azure-boards[bot] commented 6 months ago

❌ There was a problem linking to Azure Boards work item(s):

Please check the IDs and try again using the AB# syntax. Learn more

azure-boards[bot] commented 6 months ago

❌ There was a problem linking to Azure Boards work item(s):

Please check the IDs and try again using the AB# syntax. Learn more

azure-boards[bot] commented 6 months ago

❌ There was a problem linking to Azure Boards work item(s):

Please check the IDs and try again using the AB# syntax. Learn more

azure-boards[bot] commented 6 months ago

❌ There was a problem linking to Azure Boards work item(s):

Please check the IDs and try again using the AB# syntax. Learn more

azure-boards[bot] commented 6 months ago

❌ There was a problem linking to Azure Boards work item(s):

Please check the IDs and try again using the AB# syntax. Learn more

azure-boards[bot] commented 6 months ago

❌ There was a problem linking to Azure Boards work item(s):

Please check the IDs and try again using the AB# syntax. Learn more

azure-boards[bot] commented 6 months ago

❌ There was a problem linking to Azure Boards work item(s):

Please check the IDs and try again using the AB# syntax. Learn more

azure-boards[bot] commented 6 months ago

❌ There was a problem linking to Azure Boards work item(s):

Please check the IDs and try again using the AB# syntax. Learn more

azure-boards[bot] commented 6 months ago

❌ There was a problem linking to Azure Boards work item(s):

Please check the IDs and try again using the AB# syntax. Learn more