$insuranceType_list[$k]->version_list
它将“temp”描述为“test”:@ json(body('http'))['candidate'] [0] ['location'] ['x']“
如果我将此行更改为
public Bitmap addPaddingTopForBitmap(Bitmap bitmap, int paddingTop) {
Bitmap outputBitmap = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight() + paddingTop, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(outputBitmap);
canvas.drawColor(Color.RED);
canvas.drawBitmap(bitmap, 0, paddingTop, null);
return outputBitmap;
}
public Bitmap addPaddingBottomForBitmap(Bitmap bitmap, int paddingBottom) {
Bitmap outputBitmap = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight() + paddingBottom, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(outputBitmap);
canvas.drawColor(Color.RED);
canvas.drawBitmap(bitmap, 0, 0, null);
return outputBitmap;
}
public Bitmap addPaddingRightForBitmap(Bitmap bitmap, int paddingRight) {
Bitmap outputBitmap = Bitmap.createBitmap(bitmap.getWidth() + paddingRight, bitmap.getHeight(), Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(outputBitmap);
canvas.drawColor(Color.RED);
canvas.drawBitmap(bitmap, 0, 0, null);
return outputBitmap;
}
public Bitmap addPaddingLeftForBitmap(Bitmap bitmap, int paddingLeft) {
Bitmap outputBitmap = Bitmap.createBitmap(bitmap.getWidth() + paddingLeft, bitmap.getHeight(), Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(outputBitmap);
canvas.drawColor(Color.RED);
canvas.drawBitmap(bitmap, paddingLeft, 0, null);
return outputBitmap;
}
它从json读取正确的值。不确定它是否是一个错误,或者我缺少一些语法。
答案 0 :(得分:3)
您可以尝试一下史蒂文回答的问题(https://stackoverflow.com/a/44062649/7997843)或对我更明确的内容:
"temp": "@concat('\"test\":', json(body('http'))['candidates'][0]['location']['x'])"
我建议你在这里阅读工作流定义语言中的字符串插值:https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language#Expressions
您的案件似乎是一个限制案例。您可以使用@
ou @{
开始表达,然后使用函数名称开始表达,也可以从字符串开始,但是除了使用@{
之外您别无选择
答案 1 :(得分:2)
您可以尝试使用以下语法:
"temp": "\"test\": @{json(body('http'))['candidates'][0]['location']['x']}"