Conditional Formatting

Occasional Contributor

So I am building a dynamic Teams List form and I am doing conditional formatting I want certain fields to appear based on conditions, and that works however when I go into the list complete the pending actions and I choose the item I want the details pane returns the following error:

Chrisfoster1330_0-1628082071795.png

 

As you can see the list has the information, so I am not sure what I need to do. If I remove the conditional formatting from the 2 columns, the app works as expected, so I know it has to be something in the formatting that I am doing wrong. In addition when I select a record and hit edit, it

 

 

 

Chrisfoster1330_1-1628082071630.png

 

Chrisfoster1330_2-1628082071530.png

 

 
 
11 Replies
 
 
Chrisfoster1330_3-1628082071317.png

 

 

 

@Chrisfoster1330 

 

It seems like there is an issue with the JSON file. Could you please validate your JSON. Also it could be great if you could share your JSON file with dummy data and conditions used so that it could be helpful for us to look into the issue. Please make sure you have removed any PII.

 
 
 
 
 
Chrisfoster1330_4-1628082071318.png

 

 

 

So I am using simple formulas in column formatting and not really using JSON the formula for "Agent" is =if([$Category] == 'Agent', 'true', 'false') and JSON validator says the =if is wrong and it states it should be without the = but it is not a valid formula.
 
 
 
 
 
Chrisfoster1330_5-1628082071320.png

 

 

 

@Chrisfoster1330 

 

From the formula it seems like you are using Sharepoint list. Could you please let us know if it is the correct assumption? Also Please take a look at the formulae

 

If you could guide us on the resource where you are using the formula, it will be great for us to try in the right direction.  

 
 
 
 
 
Chrisfoster1330_6-1628082071322.png

 

 

 

@Meghana-MSFT Yes you are correct it is in a SharePoint List, And I am using it in a column called "Agent" and a column called "Team Meeting" and it is pointed at a column called "Category". So if the Category is "Agent" then only that field will be visible and likewise with the one for "Team". This function is working, however I am getting an error, when I am trying to view the record in the "Details Pane" and also none of the record is visible when you click on edit.  

 

My formulas appear to be correct and like I said previously when I remove the formulas the form works as expected. Here are the formulas again: =if([$Category] == 'Agent', 'true', 'false') And =if([$Category] == 'Team', 'true', 'false')

Chrisfoster1330_7-1628082071606.png

 

Chrisfoster1330_8-1628082071678.png

 

Chrisfoster1330_9-1628082071756.png

 

 
 
 
 
 
Chrisfoster1330_10-1628082071322.png

 

 

 

@Chrisfoster1330 

 

We tried to repro this at our end and we did not face any issue with view the record in the "Details Pane" and edit options. Could you please try the same thing in Sharepoint list and do the same operations? And see if you are still facing the issue?

 
 
 
 
 
Chrisfoster1330_11-1628082071323.png

 

 

 

I have deleted and rebuilt this app 4 times all with the same result. I have built other apps with the same conditional formatting and it works just fine with no issues, but try as I might I cannot get this one to work period. I have no idea where to go next
 
 
 
 
 
Chrisfoster1330_12-1628082071323.png

 

 

 

Could you please try the same thing in Sharepoint list instead of Teams lists and do the same operations? And see if you are still facing the issue?
 
 
 
 
 
Chrisfoster1330_13-1628082071323.png

 

 

 

So you are asking me to create it in SP and not Teams? Can I copy it over or do I have to build it in SP?
 
 
 
 
 
Chrisfoster1330_14-1628082071324.png

 

 

 

@Chrisfoster1330 

 

There is an option to open the list in Sharepoint. Attaching a screenshot for your reference. 

Chrisfoster1330_15-1628082071674.png

 

 
 
 
 
 
Chrisfoster1330_16-1628082071324.png

 

 

 

I have done this and I get the same issues. What is my next step, I really have to get this thing fixed. As I stated I have tried everything I know to get this to respond to no avail.
 
 
 
 
 
Chrisfoster1330_17-1628082071324.png

 

 

 

@Chrisfoster1330 ,

 

This does not seem like a teams issue. Could you please raise this on Sharepoint Lists platform.

 
1 Reply

@Chrisfoster1330 I see that you are trying to configure the SharePoint list form to show/hide the columns in list conditionally using formulas.

 

What is the data type of your Category, Team Meeting & Agent Name columns? Check Unsupported column types in conditional formulas.

 

Also, in conditional formulas, you have to use the internal name of your list column. So confirm if you are using correct internal name of category column (it might be different than display name 'Category').

 

Last, check this Microsoft official documentation if it helps: Show or hide columns in a list or library form 


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.