变量未被识别。

huangapple go评论71阅读模式
英文:

The variables are not recognized

问题

Set(VarAttachmentControl,JSON(Image1.Image,IncludeBinaryData));
Set(VarBase64,Mid(VarAttachmentControl, Find("","", VarAttachmentControl)+1, Len(VarAttachmentControl)-Find("","", VarAttachmentControl)-1));

在Power Apps中遇到了一个问题。变量未被识别。然而,当我在第一行使用";"而不是","时,一切正常。

但然后我无法使用第二个"Set"。它不会被识别。有办法解决这个问题吗?

Set(VarAttachmentControl;JSON(Image1.Image;IncludeBinaryData))

但然后我无法使用第二个"Set"。它不会被识别。有办法解决这个问题吗?

英文:

Set(VarAttachmentControl,JSON(Image1.Image,IncludeBinaryData));
Set(VarBase64,Mid(VarAttachmentControl, Find(",", VarAttachmentControl)+1, Len(VarAttachmentControl)-Find(",", VarAttachmentControl)-1));

I run into a problem in power apps. The variables are not recognized. However, when I use a ";" instead of "," in the first line, that goes well.

But then I can't use the second 'Set". It will not be recognized. Is there a weay to fix this?

Set(VarAttachmentControl;JSON(Image1.Image;IncludeBinaryData))

But then I can't use the second 'Set". It will not be recognized. Is there a weay to fix this?

答案1

得分: 1

从https://learn.microsoft.com/power-apps/maker/canvas-apps/global-apps#formula-separators-and-chaining-operator,如果您的区域设置中小数点分隔符是“,”,那么“列表分隔符”(用于分隔函数参数的令牌)变为“;”,而“链接运算符”(用于在同一表达式中分隔两个函数调用的内容)变为“;;”。由于您说在您的情况下使用“;”作为列表分隔符有效,因此您的表达式应写成如下形式:

Set(
  VarAttachmentControl;
  JSON(Image1.Image; JSONFormat.IncludeBinaryData));;
Set(
  VarBase64;
  Mid(
    VarAttachmentControl;
    Find(";", VarAttachmentControl) + 1;
    Len(VarAttachmentControl) - Find(";", VarAttachmentControl) - 1
  )
);;
英文:

From https://learn.microsoft.com/power-apps/maker/canvas-apps/global-apps#formula-separators-and-chaining-operator, if the decimal separator in your locale is ,, then the "list separator" (the token used to separate parameters to a function) becomes ;, and the "chaining operator" (what is used to separate two function calls in the same expression becomes ;;. Since you say that using ; as a list separator works in your scenario, your expression should be written as follows:

Set(
  VarAttachmentControl;
  JSON(Image1.Image; JSONFormat.IncludeBinaryData));;
Set(
  VarBase64;
  Mid(
    VarAttachmentControl;
    Find(","; VarAttachmentControl) + 1;
    Len(VarAttachmentControl) - Find(","; VarAttachmentControl) - 1
  )
);;

huangapple
  • 本文由 发表于 2023年3月9日 15:40:32
  • 转载请务必保留本文链接:https://go.coder-hub.com/75681662.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定