0

在我的 PowerApps 中,用户可以输入数据的电话字段和传真字段很少,现在它在 CDS 和电话数据类型中定义,但我不知道如何引导用户很好地输入它。我的经理希望我在用户与 App GUI 交互时为他们提供指导体验。那么如何显示带有 ( ) - 的电话输入框,以便用户填写其中的数字?

4

1 回答 1

0

There are probably many ways to accomplish this in PowerApps. The below is not the most elegant.

  1. Set textbox OnChange property to:
ClearCollect(colPhone,
    Split(txtPhone.Text, "")
);
  1. Set textbox Format property to Number
  2. Set textbox MaxLength property to 11 (depending on the format you desire)
  3. Add a label below the textbox with:
Concatenate(
    "+",
    First(colPhone.Result).Result,
    " (",
    Concat(LastN(FirstN(colPhone.Result,4).Result,3),Result),
    ")-",
    Concat(LastN(FirstN(colPhone.Result,7).Result,3),Result),
    "-",
    Concat(LastN(colPhone.Result,4),Result)
)
  1. Set label Visible property to !IsBlank(txtPhone.Text)

Example in action: enter image description here

Again, pretty hacky, but you could use it with some minor tweaks.

于 2020-11-25T17:49:58.867 回答