cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
batvan276
Resolver II
Resolver II

IF Statement - On Select & Icon/Text message

Hello Community, 

 

Adding the finishing touch to my canvas app but unsure how to go about adding an IF Statement to my current set-up.

 

I have a text input "cost" which cannot be blank but if "cost" is equal to or greater than $500,000.00 i need "reference" to be mandatory  - warning icon and text label needs to be activated on "reference" . At the same time Submit for Approval button needs to also be disabled until a 'reference' is inputted.

 

batvan276_0-1665934786044.png

 

This is what I have On Select for the "Submit for Approval" button ; 

 

 

 

If(
    'PowerAutomate'.Run(id.Text,vendor.Text,droptitle.SelectedText.Value,cost.Text,approver.SelectedText.Value,contracttype.SelectedText.Value,term.Text,reference.Text,type.Text,details.Text,docusign.Text).success = "True",
     Notify(
        "Sucess",
        NotificationType.Success,
        3000
    );
   Navigate(SucessScreen,ScreenTransition.Fade);Reset(droptitle);Reset(term);Reset(approver);Reset(cost);Reset(type);Reset(details);Reset(docusign);Reset(reference),
    Notify(
        "Your request has failed, please reach out to anonymous@anonymous.ca.",
        NotificationType.Error,
        4000
    )
)

 

This is what I have on Display Mode for the "Submit for Approval" button; 

 

If(!IsBlank(vendor.Text) && !IsBlank(proc.Text) && !IsBlank(cost.Text) && !IsBlank(term.Text) && !IsBlank(type.Text) && !IsBlank(details.Text) && (approver.SelectedText.Value <> "Select Approver") && (proc.Text <> "Unassigned") && (contracttype.SelectedText.Value <> "Select Contract Type") && !IsBlank(docusign.Text),DisplayMode.Edit,DisplayMode.Disabled)

 

This is what I have on visible for the icon for "cost"; 

 

 

 

If(!IsBlank(cost.Text),false,true)

 

 

 

Any input is appreciated.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-jefferni
Community Support
Community Support

Hi @batvan276 ,

 

The reference icon and Text Input hide when cost is less than 500,000.00, so Visible of them are the same:

IsBlank(cost.Text) || (Value(cost.Text) < 500000)

 

For the Submit Button, if reference is activated and not blank, Button needs to be visible, otherwise it's hidden, am I right? If so, use below formula on DisplayMode property:

If(
    !IsBlank(vendor.Text) && !IsBlank(proc.Text) && !IsBlank(cost.Text) && !IsBlank(term.Text) && !IsBlank(type.Text) && !IsBlank(details.Text) && (approver.SelectedText.Value <> "Select Approver") && (proc.Text <> "Unassigned") && (contracttype.SelectedText.Value <> "Select Contract Type") && !IsBlank(docusign.Text) && (reference.Visible && !IsBlank(reference.Text)),
    DisplayMode.Edit,
    DisplayMode.Disabled
)

 

Best regards,

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

1 REPLY 1
v-jefferni
Community Support
Community Support

Hi @batvan276 ,

 

The reference icon and Text Input hide when cost is less than 500,000.00, so Visible of them are the same:

IsBlank(cost.Text) || (Value(cost.Text) < 500000)

 

For the Submit Button, if reference is activated and not blank, Button needs to be visible, otherwise it's hidden, am I right? If so, use below formula on DisplayMode property:

If(
    !IsBlank(vendor.Text) && !IsBlank(proc.Text) && !IsBlank(cost.Text) && !IsBlank(term.Text) && !IsBlank(type.Text) && !IsBlank(details.Text) && (approver.SelectedText.Value <> "Select Approver") && (proc.Text <> "Unassigned") && (contracttype.SelectedText.Value <> "Select Contract Type") && !IsBlank(docusign.Text) && (reference.Visible && !IsBlank(reference.Text)),
    DisplayMode.Edit,
    DisplayMode.Disabled
)

 

Best regards,

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (6,135)