cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sheff
Frequent Visitor

Conditional Onselect for Datatable

Hi, I am using an If/IsBlank statement to determine wether or not a record exists with particular parameters. In this column I get "Needed" or "Completed".  I would like to make this an active hyperlink with the OnSelect using a condition to determine which screen to send the user when clicked. 
This doesnt appear to be working: 

If(StatusCol.Text = "Needed", Navigate(Screen1), Navigate(screen2))

Are If Statements able to be used in the OnSelect property of a Datatable? 

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @Sheff ,

Do you want to navigate to different screens based on the corresponding Status Column value?

 

Based on the formula you provided, I think there is something wrong with it. The result the StatusCol.Text formula returns is always blank.

 

As an alternative solution, please consider take a try with the following workaround:

Please modify your formula as below (I assume that your data source is a SP List😞

If(
DataTable1.Selected.Status.Value = "Needed", /* <-- Status is a Choice type column in your SP list, which used to store the "Needed" value and "Completed" */
Navigate(Screen1),
Navigate(screen2)
)

 

If your data source is not a SP list, and the Status column is a Text type column, please modify above formula as below:

If(
   DataTable1.Selected.Status = "Needed"
   Navigate(screen2)
)

 

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-xida-msft
Community Support
Community Support

Hi @Sheff ,

Do you want to navigate to different screens based on the corresponding Status Column value?

 

Based on the formula you provided, I think there is something wrong with it. The result the StatusCol.Text formula returns is always blank.

 

As an alternative solution, please consider take a try with the following workaround:

Please modify your formula as below (I assume that your data source is a SP List😞

If(
DataTable1.Selected.Status.Value = "Needed", /* <-- Status is a Choice type column in your SP list, which used to store the "Needed" value and "Completed" */
Navigate(Screen1),
Navigate(screen2)
)

 

If your data source is not a SP list, and the Status column is a Text type column, please modify above formula as below:

If(
   DataTable1.Selected.Status = "Needed"
   Navigate(screen2)
)

 

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Perfect, thanks @v-xida-msft.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (109,474)