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

Highlighted

Perfect, thanks @v-xida-msft.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (15,987)