Foreach not supporting when the result set has one record in logic apps

前端 未结 1 1575
情深已故
情深已故 2021-01-28 14:20

I have to read data from an XML and load it to SQL. So in middle I need to add some business logic for each record for which I used for each task in Logic Apps. But when there i

相关标签:
1条回答
  • 2021-01-28 14:46

    For this issue, I did some research. I convert the xml to json, while there is only one record under , the result json will be {key/value pair} but not [array]. So if we fill in For each with this value, the action will fail. I think this issue caused by design.

    For a workaround, I think we can add a specific record under , for example:

    <VDSP_INPUT_A_Set>
        <VDSP_INPUT_A_Record>
            <head>
                <blanket_number>CMC741311</blanket_number>
            </head>
            <head>
                <blanket_number>specific_test</blanket_number>
            </head>
        </VDSP_INPUT_A_Record>
    </VDSP_INPUT_A_Set>
    

    And then add a condition(If) action in For each action to determine if it is equal to "specific_test".

    If true: do insert sql

    If false: do nothing

    0 讨论(0)
提交回复
热议问题