Drop-down List to add a new for another table

Hello everyone,

Let me ask a question for drop-down List.

I have two table.

1. Search table with two columns such ID and Items.

Items column has valid_if as Products[Items].

2. Products table with two columns

as Items, Price

3. Sale table with four columns

as ID, Item, Price, Quantity, Amount

That all 

I created detail view for search table

In that view quick edit column is Items with valid_if (Products [Items])

My question is here.

 I click the items column of search table and choose the one .

I want to do add a new row for sale table when I choose one.

So how to do action 

Add a new row for sale table from search table's items with drop-down List .

Thanks 

 

0 5 69
5 REPLIES 5

I spent a while trying to understand your problem, but I kept getting stuck on the table structure.  It seems to me you should have three tables: Products where you store the product name, description  per_unit_price;  a Sales table, where you store each sales record. The Sales table would have child records of an Items table which hold individual line items in a sale.  Items would be a child of sales and would store quantity, item price, Sale_id and copy values from Product for unit price and description.  

With this structure, you be creating a new sales record and add any number of new items to the sale.  Each time you add an item, the item form would allow you to select a product then add the quantity of that product to produce a price.  

Hope this helps.

 

You should just be able to add directly to the sale table instead, you would skip the middle man! But I imagine there must be a reason you want to do a search this way, so if that's the case here's what I'd do.

You have your Search_Detail view, and the Items column I imagine is a quick edit?

You could do an Automation, but that would add the item the moment you changed it, so you could accidentally add things you don't want to. Instead try adding an action to the search table to Add a column to another table using values from this row, select the Sale table, then add the data.

This assumes the Items column in the Search table is an Enum Ref column, so you can reference the product and it's information to add to the sale table.

Ok Ok I will try your way.

By the way How to use search box from header bar in detail view . How to do it Sir?

That search bar is only for use in inline views as far as I'm aware, and its functionality can't really be changed. If you want to use that search bar then I'd suggest just adding an action to the products table to do the same add a row action to Sales, and make it appear inline so it shows up in your view, and when you click that button it adds the product to sales.

Otherwise you can add an additional column to your search table, lets call it "search", and then you change your data validity in the products column to something like this:

SELECT(Products[Items], IF(ISBLANK([_THISROW].[search]), TRUE, CONTAINS([Items],[_THISROW].[search])))

Assuming the [Items] column in the Products table is just the product name, that should allow you to filter the selected products down to whatever you're searching for

Thanks for your help Sir.

I have solution for it.

I use search box from header bar with inline view and search one and click that one Item to send sale table with event action of row select set up my address new row action. 

Thanks 

Top Labels in this Space