简体   繁体   English

如何删除 azure 逻辑应用程序中的 last last last json 记录?

[英]how to Remove last last json record in azure logic app?

{ " Date": "12/02/2022 15:01", "Product Code": "5057636582976207", "Description": "12022 3XL 372 Da", "Qty": "1", "Pricing Inc. VAT": "12" }, { " Date": "12/02/2022 15:33", "Product Code": "505763667606927", "Description": "18939 L 090 ", "Qty": "1", "Pricing Inc. VAT": "33" }, { " Date": "12/02/2022 17:07", "Product Code": "5057633566615660", "Description": "18905 ONE ", "Qty": "1", "Pricing Inc. VAT": "10" }, { " Date": "", "Product Code": "", "Description": "", "Qty": "96", "Pricing Inc. VAT": "1883.6" } the problem is price inc vat in last array will always change so cant use Replace() any idea? { " Date": "12/02/2022 15:01", "Product Code": "5057636582976207", "Description": "12022 3XL 372 Da", "Qty": "1", "Pricing Inc. VAT" : "12" }, { " Date": "12/02/2022 15:33", "Product Code": "505763667606927", "Description": "18939 L 090 ", "Qty": "1", " Pricing Inc. VAT": "33" }, { " Date": "12/02/2022 17:07", "Product Code": "5057633566615660", "Description": "18905 ONE ", "Qty": " 1", "Pricing Inc. VAT": "10" }, { " Date": "", "Product Code": "", "Description": "", "Qty": "96", "Pricing Inc. VAT": "1883.6" }问题是最后一个数组中的价格 inc vat 总是会改变所以不能使用 Replace() 有什么想法吗?

You can use the Below Expression to fetch the specific result您可以使用下面的表达式来获取特定结果

// Use add & length expression add(length(outputs('Compose')),-1) to remove the no of values 

take(outputs('Compose'),add(length(outputs('Compose')),-1))

Follow the workaround遵循解决方法

Here I am using your JSON payload and processed with it.在这里,我使用您的 JSON 有效载荷并对其进行处理。

{
    "result": [
        {
            " Date": "12/02/2022 15:01",
            "Product Code": "5057636582976207",
            "Description": "12022 3XL 372 Da",
            "Qty": "1",
            "Pricing Inc. VAT": "12"
        },
        {
            " Date": "12/02/2022 15:33",
            "Product Code": "505763667606927",
            "Description": "18939 L 090 ",
            "Qty": "1",
            "Pricing Inc. VAT": "33"
        },
        {
            " Date": "12/02/2022 17:07",
            "Product Code": "5057633566615660",
            "Description": "18905 ONE ",
            "Qty": "1",
            "Pricing Inc. VAT": "10"
        },
        {
            " Date": "",
            "Product Code": "",
            "Description": "",
            "Qty": "96",
            "Pricing Inc. VAT": "1883.6"
        }
    ]
}

在此处输入图像描述

Results结果

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM