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

Re: Conditional Onselect for Datatable

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

Re: Conditional Onselect for Datatable

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
Frequent Visitor

Re: Conditional Onselect for Datatable

Perfect, thanks @v-xida-msft.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (4,751)