Code Monkey home page Code Monkey logo

Comments (10)

thechriskent avatar thechriskent commented on June 19, 2024

Turn debugMode off to suppress this error:

"debugMode": false

from list-formatting.

Kirill-FP avatar Kirill-FP commented on June 19, 2024

Thanks. This works!

from list-formatting.

ErikSavetheCrew avatar ErikSavetheCrew commented on June 19, 2024

I'm having the same type of issue, but with a lookup field and a person field - when the fields are blank, the records aren't returned in the (formatted) view at all. I noticed the error when I had a simple text element:

{
    "elmType": "span",
    "txtContent": "[$TeamCategoryLookup.lookupValue]"
}

I've tried all kinds of options - including turning debug mode off and using a lot of conditional statements to set it to a blank value if it's empty. Unfortunately nothing I've tried works, including the following:

"txtContent": "= if(ToString([$TeamCategoryLookup.lookupValue])=='', '',[$TeamCategoryLookup.lookupValue])"
"txtContent": "= if(ToString([$TeamCategoryLookup])=='', '',[$TeamCategoryLookup.lookupValue])"

"txtContent": "= if(isEmpty([$TeamCategoryLookup.lookupValue]), '',[$TeamCategoryLookup.lookupValue])"
"txtContent": "= if(isEmpty([$TeamCategoryLookup]), '',[$TeamCategoryLookup.lookupValue])"

"txtContent": "= if(isNull([$TeamCategoryLookup.lookupValue]), '',[$TeamCategoryLookup.lookupValue])"
"txtContent": "= if(isNull([$TeamCategoryLookup]), '',[$TeamCategoryLookup.lookupValue])"

"txtContent": "= if(isBlank([$TeamCategoryLookup.lookupValue]), '',[$TeamCategoryLookup.lookupValue])"
"txtContent": "= if(isBlank([$TeamCategoryLookup]), '',[$TeamCategoryLookup.lookupValue])"

"txtContent": "= if(isBlank(ToString([$TeamCategoryLookup.lookupValue])), '',[$TeamCategoryLookup.lookupValue])"
"txtContent": "= if(isBlank(ToString([$TeamCategoryLookup])), '',[$TeamCategoryLookup.lookupValue])"

Any ideas? (as a side note, should I be using the operator style instead of ifs?)

from list-formatting.

PopWarner avatar PopWarner commented on June 19, 2024

Quick question for you @ErikSavetheCrew, is your lookup field pointing a person field? Wanted to confirm before I did some testing for ya. :)

from list-formatting.

ErikSavetheCrew avatar ErikSavetheCrew commented on June 19, 2024

@PopWarner It's not, it's just pointing at some text values in another list. I mentioned the people field because I think I'm having the same issue with a people field (it's hard to say for certain, but it might make sense because they're both objects).

I've attached the full code if it's helpful (the problem fields are [$T1Assignee] and [$TeamCategoryLookup]). It's a little buggy pulling records in general right now (it won't show certain records until filters are selected on the list, and some things don't appear at all), but after reviewing what's in the records, I think it's this object issue that's at the root of it.

Appreciate any ideas you come up with!

TileImproved6.txt

from list-formatting.

PopWarner avatar PopWarner commented on June 19, 2024

@ErikSavetheCrew Great...Thank you. I'll try to take a look in my tenant and see what I see as well. :)

from list-formatting.

PopWarner avatar PopWarner commented on June 19, 2024

@ErikSavetheCrew, quick question, when you say "when the fields are blank", do you mean the lookup field in the lookup list is blank or do you mean the list that your applying the ViewFormatting to has a list item, where you have not selected anything from the lookup field?

I'm trying to mimic the scenario, wanted to make sure I'm testing exactly as you are.. :)

from list-formatting.

ErikSavetheCrew avatar ErikSavetheCrew commented on June 19, 2024

from list-formatting.

PopWarner avatar PopWarner commented on June 19, 2024

@ErikSavetheCrew Thanks!!!

So I started with a VERY simple couple of list items and lists. I've attached my LF JSON.

In the picture, it seemed to work for me. The first list item is one where I provided a title AND selected from the lookup. The second is where I provided a title, but NOT a lookup choice. They both seem to show up for me using the attached JSON.

Curious if the attached JSON works for you? My thought is if so, perhaps something else is going on with the larger JSON you attached earlier. I'm happy to keep helping troubleshoot, but figured I'd check with ya and see if this works first? :)

image

ErikSavetheCrewSample.txt

from list-formatting.

ErikSavetheCrew avatar ErikSavetheCrew commented on June 19, 2024

Thanks @PopWarner. I'll create another list in a bit to test it out there. To your point about the larger JSON file, this is actually part of a bigger problem, which I was going to post elsewhere (and still can if it makes sense, it's a long, stupid story):

I created a heavily-modified card view based on these tiles as a starting point. The view it's applied to shows every entry in a certain list, and when viewing without any formatting all 277 rows load appropriately (in batches of 50 as specified in the view).

The issue is, when loading the view with formatting on, all the cards will flash on the screen briefly, but then the majority will disappear (except for 3, which I'll called "Green"). I attached a .gif that shows what I mean. Depending on what filters are applied to the view, different amounts of cards will load, so it's not an item limit, and I've had the behavior appear in both Firefox and Chrome. The odd thing about it is that certain cards won't show up initially, but if I open up the sidebar and filter (or use the view filters), more cards will show up after filtering (I'll call those "Yellow").

So I combed through the records to see if it's a particular field that's causing the odd behavior, which is how I ended up here. I realized that records without a value in one of these two fields ([$T1Assignee] and ([$TeamCategoryLookup]) never showed up, no matter how many filters I applied (I'll call these "orange"). Looking even further (and this is kind of hard to word, my apologies), when the view is filtered so that none of these "orange" problematic records are in the subset, every (green and yellow) record loads correctly. So it seems like not only do these problematic records not display, but they keep other (yellow) records from displaying as well.

It's also possible it's something else entirely! Today I've been combing through some more, and when I removed both fields it got glitchy for a second, and then showed the original 3 "green" ones plus some random "orange" ones, and the same behavior while filtering. I about lost my lid. Not sure where I'm going wrong.
loadingerror2

from list-formatting.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.