Stock Managing with colours

Hello again,

Today I tried to work in a Stock Manager but, after 6 hours of testing and trying, I am here asking help another day :smiley:

I want to change color between these 4 posibilities
Inventario1

Thank you guys for heping me another day

I’m not entirely sure what you’re asking here…

But broadly speaking, if you’re asking about storing and setting dynamic colours, the simplest way will be to use an option set.

I’d create an option set for Availability, with 4 options (Available, Little Stock, not Available, and Doesn’t Exist), with an attribute for Colour (of type text) which will be the hex code of the colour you want.

Then just refer to the option set options according.

Thank you for helping @adamhholmes.
I tried yesterday and I made some advances but I am not able to change a field of thing in he database to change de colour. I show you with screeshots now.

First of all, I made an option set lilke you proposed me

Stock_managing_1

I made mi thing to save in the database and added the field.

Stock_managing_2

I created some things and tried to change some fields.

Stock_managing_3

When we go to Design I made a Repeating Group with that thing, in the example “Empanadas”

I made a Text to the name of thing and a shape which will change the colour with the Disponibilidad Field.

Changing the field is made for a Popup with different shapes.

Stock_managing_6

And now I have the problem. I did this in the workflow but it doesn’t work

Stock_managing_7

Now, when I click in some colour shape of the popup anything happens. If we read the debugger we can see that it “works” but anything change. I try to change the colour modifying Database while is running and It works.

And It’s still black. What’s wrong in the app? Could you help me please?
PS: I upload a lot of screenshots to be clear with the explanation.

Another time I thank you helping me! ^^

I’m not entirely sure what you’re doing there to be honest…

You shouldn’t need any conditionals to change the colours (that’s what he option set is for)…

There are a few approaches you could take for this…

One is to have a field in the database (as you’ve done here), and just change it accordingly when the stock levels reach a certain level. Then it’s as simple as setting the colour to be the Thing’s Stock Level (option set) colour.

Alternatively, you can do away with saving anything in the database, and just use conditionals on the page to define the colour based on the Thing’s current stock level.

I.e. you’d need to have an attribute on each option in the option set do define the stock level for that particular option (maybe 2 number attributes - 1 for min and 1 for max)

Then just set the colour on the page to ‘get an option’, use All Options: filtered, and filter it by the Thing’s current stock level - then set the colour to the option set’s colour attribute.

There are probably other ways to do it as well (especially if you want to have different stock levels defined as the different option for different things) but those are the basic ways to investigate.

Hello again,
I want to build a web which change the color of each cell according stock of that product but It will be changed manually for a worker.

One is to have a field in the database (as you’ve done here), and just change it accordingly when the stock levels reach a certain level. Then it’s as simple as setting the colour to be the Thing’s Stock Level (option set) colour.

image

Is that what are you telling about? That’s make when I press a shape I should change the Field Disponibilidad of associatedThing but it doesn’t work. And I don’t know why to be honest.

If It’s wrong could you tell or link me something that can help me? I watched videos and read webs but I should be so silly :sweat_smile: :joy:

Thank you another time for your patience, I really aprreciate it