Azure / LogicAppsUX

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

Update item keeps removing the selected value from a choice in designer view of a standard logic app. #5206

Closed tergar1 closed 1 month ago

tergar1 commented 3 months ago

Describe the Bug with repro steps

  1. I added a choice column (Status) to be updated using the update item connector.
  2. Select the required choice.
  3. Save the flow .
  4. If I view the code the choice is there no problem and it works well.
  5. But if I go back into the flow using designer and change anything in the flow and save it, the choice is deleted out of the code.

What type of Logic App Is this happening in?

Standard (Portal)

Are you using new designer or old designer

New Designer

Did you refer to the TSG before filing this issue? https://aka.ms/lauxtsg

Yes

Workflow JSON

{
    "definition": {
        "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
        "actions": {
            "Completed": {
                "actions": {
                    "Terminate_2": {
                        "inputs": {
                            "runStatus": "Cancelled"
                        },
                        "runAfter": {
                            "Update_item-completed": [
                                "SUCCEEDED"
                            ]
                        },
                        "type": "Terminate"
                    },
                    "Update_item-completed": {
                        "inputs": {
                            "body": {
                                "BodyOfRequest": "@triggerBody()?['BodyOfRequest']",
                                "EmailTo": "@triggerBody()?['EmailTo']",
                                "Log": "Event:Completed||User:@{triggerBody()?['Editor']?['DisplayName']}||Date:@{convertFromUtc(utcnow(),'GMT Standard Time')} , @{triggerBody()?['Log']}",
                                "RequestCompleted": "@{convertFromUtc(utcnow(),'GMT Standard Time')}",
                                "Title": "@triggerBody()?['Title']"
                            },
                            "host": {
                                "connection": {
                                    "referenceName": "sharepointonline"
                                }
                            },
                            "method": "patch",
                            "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://traffictechinc.sharepoint.com/sites/CargoWiseIntergration-SalesReports-Europe'))}/tables/@{encodeURIComponent(encodeURIComponent('5d264f61-5afc-4a32-8c82-e3b88de4bd87'))}/items/@{encodeURIComponent(triggerBody()?['ID'])}"
                        },
                        "type": "ApiConnection"
                    }
                },
                "else": {
                    "actions": {}
                },
                "expression": {
                    "and": [
                        {
                            "not": {
                                "equals": [
                                    "@triggerBody()?['RequestCompleted']",
                                    ""
                                ]
                            }
                        },
                        {
                            "and": [
                                {
                                    "not": {
                                        "equals": [
                                            "@triggerBody()?['CompleteStatus']?['Value']",
                                            ""
                                        ]
                                    }
                                },
                                {
                                    "not": {
                                        "equals": [
                                            "@triggerBody()?['CompleteStatus']?['Value']",
                                            "Working"
                                        ]
                                    }
                                }
                            ]
                        }
                    ]
                },
                "runAfter": {
                    "SendRequest": [
                        "SUCCEEDED"
                    ]
                },
                "type": "If"
            },
            "SendRequest": {
                "actions": {
                    "For_each_emailto": {
                        "actions": {
                            "Append_to_emailto_array": {
                                "inputs": {
                                    "name": "emailto_array",
                                    "value": "@items('For_each_emailto')?['Email']"
                                },
                                "type": "AppendToArrayVariable"
                            }
                        },
                        "foreach": "@triggerBody()?['EmailTo']",
                        "type": "Foreach"
                    },
                    "Has_Attachments": {
                        "actions": {
                            "For_each_attachment": {
                                "actions": {
                                    "Append_attachments_array": {
                                        "inputs": {
                                            "name": "attachment_array",
                                            "value": {
                                                "ContentBytes": "@{body('Get_attachment_content')['$content']}",
                                                "Name": "@{items('For_each_attachment')?['DisplayName']}"
                                            }
                                        },
                                        "runAfter": {
                                            "Get_attachment_content": [
                                                "SUCCEEDED"
                                            ]
                                        },
                                        "type": "AppendToArrayVariable"
                                    },
                                    "Get_attachment_content": {
                                        "inputs": {
                                            "host": {
                                                "connection": {
                                                    "referenceName": "sharepointonline"
                                                }
                                            },
                                            "method": "get",
                                            "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://traffictechinc.sharepoint.com/sites/CargoWiseIntergration-SalesReports-Europe'))}/tables/@{encodeURIComponent(encodeURIComponent('5d264f61-5afc-4a32-8c82-e3b88de4bd87'))}/items/@{encodeURIComponent(encodeURIComponent(triggerBody()?['ID']))}/attachments/@{encodeURIComponent(items('For_each_attachment')?['Id'])}/$value"
                                        },
                                        "type": "ApiConnection"
                                    }
                                },
                                "foreach": "@body('Get_attachments')",
                                "runAfter": {
                                    "Get_attachments": [
                                        "SUCCEEDED"
                                    ]
                                },
                                "type": "Foreach"
                            },
                            "Get_attachments": {
                                "inputs": {
                                    "host": {
                                        "connection": {
                                            "referenceName": "sharepointonline"
                                        }
                                    },
                                    "method": "get",
                                    "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://traffictechinc.sharepoint.com/sites/CargoWiseIntergration-SalesReports-Europe'))}/tables/@{encodeURIComponent(encodeURIComponent('5d264f61-5afc-4a32-8c82-e3b88de4bd87'))}/items/@{encodeURIComponent(encodeURIComponent(triggerBody()?['ID']))}/attachments"
                                },
                                "type": "ApiConnection"
                            },
                            "Send_an_email_(V2)-copy": {
                                "inputs": {
                                    "body": {
                                        "Attachments": "@variables('attachment_array')",
                                        "Body": "<p><b><strong style=\"font-size: 10px;\">**Please reply to all**</strong></b></p><p>@{triggerBody()?['BodyOfRequest']}</p><p>Best Regards</p><p>@{triggerBody()?['Editor']?['DisplayName']}</p><p><a href=\"@{triggerBody()?['{Link}']}\"><span style=\"background-color: rgb(255, 255, 255); font-size: 10px;\">Click Here to open item</span></a></p>",
                                        "Cc": "tt-cw-apps@traffictech.com",
                                        "Importance": "High",
                                        "ReplyTo": "@triggerBody()?['Editor']?['Email']",
                                        "Subject": "@{concat(triggerBody()?['Title'],' - Quote Request - TST',triggerBody()?['ID'])}",
                                        "To": "@body('Join')"
                                    },
                                    "host": {
                                        "connection": {
                                            "referenceName": "office365_1"
                                        }
                                    },
                                    "method": "post",
                                    "path": "/v2/Mail"
                                },
                                "runAfter": {
                                    "For_each_attachment": [
                                        "SUCCEEDED"
                                    ]
                                },
                                "type": "ApiConnection"
                            }
                        },
                        "else": {
                            "actions": {
                                "Send_an_email_(V2)": {
                                    "inputs": {
                                        "body": {
                                            "Body": "<p><b><strong style=\"font-size: 10px;\">**Please reply to all**</strong></b></p><p>@{triggerBody()?['BodyOfRequest']}</p><p>Best Regards</p><p>@{triggerBody()?['Editor']?['DisplayName']}</p><p><a href=\"@{triggerBody()?['{Link}']}\"><span style=\"background-color: rgb(255, 255, 255); font-size: 10px;\">Click Here to open item</span></a></p>",
                                            "Cc": "tt-cw-apps@traffictech.com",
                                            "Importance": "High",
                                            "ReplyTo": "@triggerBody()?['Editor']?['Email']",
                                            "Subject": "@{concat(triggerBody()?['Title'],' - Quote Request - TST',triggerBody()?['ID'])}",
                                            "To": "@body('Join')"
                                        },
                                        "host": {
                                            "connection": {
                                                "referenceName": "office365_1"
                                            }
                                        },
                                        "method": "post",
                                        "path": "/v2/Mail"
                                    },
                                    "type": "ApiConnection"
                                }
                            }
                        },
                        "expression": {
                            "and": [
                                {
                                    "equals": [
                                        "@triggerBody()?['{HasAttachments}']",
                                        "@true"
                                    ]
                                }
                            ]
                        },
                        "runAfter": {
                            "Join": [
                                "SUCCEEDED"
                            ]
                        },
                        "type": "If"
                    },
                    "Join": {
                        "inputs": {
                            "from": "@variables('emailto_array')",
                            "joinWith": ";"
                        },
                        "runAfter": {
                            "For_each_emailto": [
                                "SUCCEEDED"
                            ]
                        },
                        "type": "Join"
                    },
                    "Terminate_1": {
                        "inputs": {
                            "runStatus": "Cancelled"
                        },
                        "runAfter": {
                            "Update_item": [
                                "SUCCEEDED"
                            ]
                        },
                        "type": "Terminate"
                    },
                    "Update_item": {
                        "inputs": {
                            "body": {
                                "BodyOfRequest": "@triggerBody()?['BodyOfRequest']",
                                "EmailTo": "@triggerBody()?['EmailTo']",
                                "Log": "Event:Created||User:@{triggerBody()?['Author']?['DisplayName']}||Date:@{convertFromUtc(utcnow(),'GMT Standard Time')}",
                                "RequestNumber": "@{triggerBody()?['ID']}",
                                "RequestSent": "@{convertFromUtc(utcnow(),'GMT Standard Time')}",
                                "Status": {
                                    "Value": "RequestSent"
                                },
                                "Title": "@triggerBody()?['Title']"
                            },
                            "host": {
                                "connection": {
                                    "referenceName": "sharepointonline"
                                }
                            },
                            "method": "patch",
                            "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://traffictechinc.sharepoint.com/sites/CargoWiseIntergration-SalesReports-Europe'))}/tables/@{encodeURIComponent(encodeURIComponent('5d264f61-5afc-4a32-8c82-e3b88de4bd87'))}/items/@{encodeURIComponent(triggerBody()?['ID'])}"
                        },
                        "runAfter": {
                            "Has_Attachments": [
                                "SUCCEEDED"
                            ]
                        },
                        "type": "ApiConnection"
                    }
                },
                "else": {
                    "actions": {}
                },
                "expression": {
                    "and": [
                        {
                            "equals": [
                                "@triggerBody()?['Status']?['Value']",
                                "SendRequest"
                            ]
                        },
                        {
                            "equals": [
                                "@triggerBody()?['CompleteStatus']?['Value']",
                                "Working"
                            ]
                        }
                    ]
                },
                "runAfter": {
                    "var_attachment_array": [
                        "SUCCEEDED"
                    ]
                },
                "type": "If"
            },
            "autoupdate": {
                "actions": {
                    "Terminate": {
                        "inputs": {
                            "runStatus": "Cancelled"
                        },
                        "type": "Terminate"
                    }
                },
                "else": {
                    "actions": {}
                },
                "expression": {
                    "and": [
                        {
                            "equals": [
                                "@triggerBody()?['Editor']?['Email']",
                                "tt-cw-apps@traffictech.com"
                            ]
                        }
                    ]
                },
                "runAfter": {},
                "type": "If"
            },
            "var_attachment_array": {
                "inputs": {
                    "variables": [
                        {
                            "name": "attachment_array",
                            "type": "array"
                        }
                    ]
                },
                "runAfter": {
                    "var_emailto_array": [
                        "SUCCEEDED"
                    ]
                },
                "type": "InitializeVariable"
            },
            "var_emailto_array": {
                "inputs": {
                    "variables": [
                        {
                            "name": "emailto_array",
                            "type": "array"
                        }
                    ]
                },
                "runAfter": {
                    "autoupdate": [
                        "SUCCEEDED"
                    ]
                },
                "type": "InitializeVariable"
            }
        },
        "contentVersion": "1.0.0.0",
        "outputs": {},
        "triggers": {
            "When_an_item_is_created_or_modified": {
                "inputs": {
                    "host": {
                        "connection": {
                            "referenceName": "sharepointonline"
                        }
                    },
                    "method": "get",
                    "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://traffictechinc.sharepoint.com/sites/CargoWiseIntergration-SalesReports-Europe'))}/tables/@{encodeURIComponent(encodeURIComponent('5d264f61-5afc-4a32-8c82-e3b88de4bd87'))}/onupdateditems"
                },
                "recurrence": {
                    "frequency": "Minute",
                    "interval": 1
                },
                "splitOn": "@triggerBody()?['value']",
                "type": "ApiConnection"
            }
        }
    },
    "kind": "Stateful"
}

Screenshots or Videos

No response

Browser

Chrome and Edge

Additional context

No response

preetriti1 commented 1 month ago

@tergar1 - I have tried reproducing this issue but can't, can you try again in the portal and update here?

github-actions[bot] commented 1 month ago

We requested more information to triage this issue. If the issue goes more than 7 days with no more information it'll be automatically closed.

github-actions[bot] commented 1 month ago

This issue has been closed because the information requested wasn't provided within 7 days.