cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
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
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
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Top Solution Authors
Top Kudoed Authors
Users online (96,406)