Hi. I have a component that has a text input and a text label. This text label is used to indicate the error in the text label. I created an attached custom behavior property that is linked to the onchange of the text input. This property returns a record composed of ErrorText and ErrorVisibility. Also in the onchange of the text input I am setting a variable inside the component to use the output to set the visibility and text of the text label.
Set(varErrorInfo,TextInputWithError.TextLabelOnChange());
I use this varErrorInfo to set the visibility and text of the text label.
So in my application I am putting some logic to check if the text of the component is blank. I am exposing the text as an output property in the component.
Here is my logic for checking if its blank:
If(IsBlank(Self.Text), {ErrorVisibility: true, ErrorText: "Email cannot be blank!"}, {ErrorVisibility: false, ErrorText: ""})
So this works fine but when I try to add logic to check if its duplicate like this, it does not work.
If(
IsBlank(Self.Text),
{
ErrorVisibility: true,
ErrorText: "Email cannot be blank!"
};
Notify("Email cannot be blank");
,
If(
IsBlank(
LookUp(
Reviewers,
Email = Self.Text
)
),
{
ErrorVisibility: false,
ErrorText: ""
},
{
ErrorVisibility: true,
ErrorText: "Email already exists"
};
Notify("Email duplicate");
)
);
I am confused to what the issue is. I added Notify events to make sure my logic is correct and I am getting the correct Notifications but my component doesnt seem to be getting the output properly.