Dynamic attribute show not working correctly

I have a nodejs project with Bootstrap 5 accordion with menu categories
In each menu category are 1 or many menu items
Each menu item has a button that when clicked opens a modal with that menu item’s details and pricing
Pricing falls in 4 categories, entree, main, banquet, and bigpot
For some menu categories not all pricing categories are used so I am trying to hide them

Example menu category soups have pricing category bigpot, whereas menu category entrees does not have bigpot.

  1. Menu item button click initiates flow editor loading the prices for that menu item
    Then goes through the pricing repeat and setting variable vBigPot to true if prices are found

  2. Row repeat expression is set to prices loaded in 1)

  3. Column has dynamic attribute to show column only when vBigPot == true

Problem is that I have to click menu item button 2x times before modal shows correct pricing columns
So on 2nd button click the dynamic attribute takes effect
It is like the dynamic attribute is being evaluated before the prices are loaded


image
image
image
image

There is not enough info on what you have done, so I will give you an impression of what I would do.

Starting with the database structure, there is a main table containing the menu items. Then there is a sub-table that contains the categories and prices. As an example, the main table contains Calamari, the sub-table contains the three categories, entrée, main and banquet.

Soup would contain all 4 categories.

A Server Connect supplies the data source for all of the menus and includes the data from the sub-tables. A Data Detail contains a selected item data source based on the Server Connect.

When the button is clicked on, it selects the Data Detail item and opens the Modal. The modal is populated with the data from the Data Detail.

Using this method, there is no need to hide anything. In the case of the Calamari, bigpot will not show up.

To give you an idea of what I mean, have a look at

Thank you Ben I understand what you mean, in my case there is a little more to the data structure.
Each menu item within a category like e.g. Entree can have many prices, each price is attached to a meat selection e.g. Beef, Chicken, Pork, …

I have a many to many db relationship between “menu item” & “menu item price” & “meat selection”, where prices are stored in the joining table “menu item price”. Since the user can dynamically edit this data through an admin page I am trying to cater for different scenarios, at this time it seems like a good idea to dynamically hide a column based on what I described.

Granted there might be a different / better way to achieve my goal, but I have come this far and at this stage would really like to gain some understanding in Wappler order of execution, and why I need to click the button twice in order for my column to be shown.

I’m just wondering why you are using a flow to set a secondary value using a primary value as in

image
where you are setting the value of vBigpot using price_bigpot.

Why not use price_bigpot or even price_bigpot > 0 instead of vBigpot.valie == true whem showing the field.

As I said, there is not enough info to help you further. Even after my first reply, more info appeared changing the original scenario. Not a criticism, just stating the facts.

I have had no need to use flows, hence I know little about them. What I do know is that the steps are executed asynchronously, so there should not be a problem there. This means that there must be a problem elsewhere in the logic.

Thanks Ben for your feedback, it is appreciated.
More info appeared to answer you with a reason as to why the alternative way wouldn’t work. I left it out of my 1st post as trying to keep it as simple as I could, and felt this info added no value to my original question, which was “why do I need to click twice to get dynamic Show attribute to work”

I am using a flow as I am trying to set a dynamic “Show” attribute on a column based on values in a repeat. To my understanding this cannot be done in the actions editor

It is also my understanding that the actions editor runs asynchronously, whereas the flow editor executes actions synchronously (next action is started after previous action is finished, which is what I need in this case)

I have attached a simple screen shot showing data structure in a table format for 2x menu items. A SQL query retrieves Menu Item 1, and retrieves the complete table of data below it in a single query.
image

For menu item 1 you will notice column “Other” has all 0’s in it, so this column needs to be hidden for menu item 1, but for menu item 2 column “Entree” needs to be hidden.

To my mind a simple query will not do this (maybe a more complex query might but this is over my head). I decided to pull the data then in a flow repeat initialise a variable vOther false before repeat (so column Other is hidden), and check each value stored against Beef, Chicken, Pork, … and if any of them is >0 then toggle vOther to true, so now the column Other would be displayed.
This is then repeated for other columns using their own variable, so column Entree would get a variable vEntree …

I hope this makes sense, and apologies for confusion around not providing enough information, this was not my intention, I think this excel image should clarify things.

I think ** and I may be wrong** that you’re over complicating what’s needed by using a flow.

All you need to do is load the server connect an link the repeat for the menu items to the SC. For the ‘other’ column use the show attribute linked to $value.max('price_bigpot') > 0 (You can use the data picker to select $value and then the max formatter)

Thank you Ben, this is something new to me, have tried it, but it doesn’t work, will check it out further.