【发布时间】:2021-12-19 02:11:56
【问题描述】:
在逻辑应用中我有 json 数据:
{
"amount": "116159.90",
"date": "2021-11-04",
"fee": "3412.30"
}
第 1 步: 我想将此数据发送到 azure 函数
第 2 步: 我想输入 json 数据(金额、日期和费用),所以我可以将它作为 C# 代码发送到 api 端点,所以它看起来像下面的代码。其余数据是硬编码的。
在此处查看文档(创建凭证 C#)https://developer.fortnox.se/documentation/resources/vouchers/
VoucherConnector connector = new VoucherConnector();
List<VoucherRow> rows = new List<VoucherRow>();
rows.Add(new VoucherRow() {
Account = "2480",
Description = "Checkräkningskredit, kortfristig",
**Debit = "AMOUNT",**
Credit = "0"
});
rows.Add(new VoucherRow() {
Account = "6092",
Description = "Shopify Fee",
**Debit = "FEE",**
Credit = "0"
});
rows.Add(new VoucherRow() {
Account = "1509",
Description = "Shopify fordran",
Debit = "0",
**Credit = "(=AMOUNT+FEE)"**
});
Voucher result = connector.Create(new Voucher() {
****TransactionDate = "DATE",****
Description = "Inbetalning Shopify",
VoucherRows = rows,
VoucherSeries = "A"
});
【问题讨论】:
-
从您的问题来看,尚不清楚您在流程的哪个具体部分遇到了困难。
-
因为数据是位于逻辑应用程序中的 json 格式,所以我的问题是如何使 json 数据可供函数使用,因为代码在 C# 中,所有代码都已经完成后,我只需要知道如何将数据放入相应的凭证行中,如上面的描述。逻辑应用按计划运行,因此每次运行都会有不同的数据。
标签: c# json api azure-functions azure-logic-apps