Need Help with Changing colour of list view items based on status

Hey Guys,

Thank you for being patient and answering all my stupid questions. I am kind of trying to make my UI look more presentable.

I have a list view and the list view has a status “Confirmed” , “Initial Conversation”, “Lead” etc

I have separated these based on status in List view. I would want either to have a small indicator Next to each list view items with colour to show the difference Like Confirmed to be Green , Lead to be blue colour etc

This can either be in marked portion which has ‘2’ in the screens hot below this will be for each ITEM in the list view —Its using the list view image ciomponent

Or it can be in the “1” marked portion at the top where it will be for each of the status. and wont be for each List view item.

Or any place you would recommend.

Would also need it in the Detail page as sown in screenshot 2. Marked as “S3”

Would really appreciate your help.

Regards,
Dilip

You could use that same technique that we discussed in your earlier question to dynamically generate an image using dummyimage.com. The same image could be used both in your Collection and a Title component.

Hi Darren,

It might be a stupid question.

Will this approach let me create just an image colour next to title devotion for each list view item?

How would that work?

Because if I use that then I need to specify the image by link in config right ?

I am attaching marked section in my screenshot.

I am confused as to how does it work with changing link dynamically from the config end.?

Regards,
Dilip

Yes, you want the colour of the image to change based on status, right?

So what you do is first create an if-then-else column:

  • If Status is Lead, then FFFF00 (yellow)
  • If Status is Confirmed, then 008000 (green)
  • etc

Then use that if-then-else column as an input in a template column to generate the dummy image URL, and use that template column as the image in your components.

thank you for the reply Darren, Let me try this.

Regards,
Dilip

Trying to work on it Darren. I got another silly doubt. I am using the table called as inbound_brand which already has lot of rows as records.

Would I need to create a separate table for these status called status mapping, and then fetch the value using single value column from here to inbound_brand and then do the if else condition column in inbounds_brand?

Or is there any recommended approach.

Create the columns in your Inbound Brand table. The same table that is used as the source of your collection.

Hi Darren,

I already have lot of rows having values on my inblunds_brands table

These are values of each brand enquiry I am getting and each of these have a status amongst the one I have specified

Wouldn’t creating another table with values be a better approach ?

Please advice

Regards,
Dilip

No. And in fact it won’t work if you create another table.
Just create those columns in the existing table the way I described, and it will work.
Trust me.

Actually, if you already have another table that lists each of your possible Status values, one per row, you could use that. Generate the image in that table using a template column, then from your Inbound Brand table use a Relation & Lookup to fetch the correct image for each row. So yes, you could use another table. Either way will work. Your choice.

Hi Darren,

Trying the approach of putting the values in the same table.

Could you guide me as wether this is the right way I am doing and recommended?

I have created separate columns only to store this value and generate template values.

The other values of rows are in the columns before marked in Red
Would this be something schematically correct? Attaching screenshot for reference.

Regards,
Dilip

Okay, a couple of things.

  • Firstly, don’t you already have a Status column in this table? The idea is to generate an image for every row in this table, with the colour determined by the Status value in each row.
  • So, you should delete those first four columns that you drew a red box around. You don’t need them.
  • You need to add just two columns to that table, as I described earlier:
  • Start with the if-then-else column. This should give you a different hex value on every row in the table.
  • And then the Template column, this will return the dummy image URL, using the if-then-else column as a replacement to set the colour.

Got it Darren

Here is the updated Screenshot.

Now since I am not updating any value in template can I leave it blank after the text in URL?

https://dummyimage.com/600×400/FF4500/fff&text=

what to put after text ? in above URL?

As in in the example you gave previously I was appending some value. What should I do here?

Regards,
Dilip

You only want the image, right?
So you can leave the text empty.
Now configure your components to use that column as the image source.

haha, and after all this I just realised that because you only want the image, you could use the Image from Colour column and point it at the if-then-else column. And then you can do away with the template column :slightly_smiling_face:

Yeah I just needed the Colour in this instance.

I actually did it as per your instruction but somehow dont find the colour I put up in the if else condition.

Is there something I am doing wrong?

Here is the screenshot of the UI

Here is the screenshot of the Data

For circles is there different dimension I should use?

Regards,
Dilip

would there some issue if I keep the dimension as 600*400 and the view would be circular as per the screenshot attached? I cant get to render the colour at all.

My If else condition is working as expected though.

Regards,
Dilip

I got it to work after I reduced dimension to 50*50

Thank you Darren.

Regards,
Dilip

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.