Dependent dropdown from ref item?

Guys, I'm sorry if this has been approached before. I have looked into some posts but none of them worked for me... That's why I'm creating another one.

integraOdontoSj_0-1686690216074.png

I have these 2 dropdowns in my app, for drug prescription. The  number 3 (Id da Finalidade da Prescriรงรฃo Medicamentosa) has values regarding kind of the use of the drug, and the item 4, has the list of drugs.

I'd like to show only the options in number 4 that have the same "use of the drug" as the one I selected in the number 3.

I have tried using SELECT in the "valid if" section of the number 4 (Id do Medicamento), but since it is a REF to my drug list, it says it cannot compare.

Below is the table of the prescription:

integraOdontoSj_1-1686690434184.png

this table is like a "details" table from the main prescription table. That's why the "Id da Prescriรงรฃo Medicamentosa" is a ref.

The "Id da Finalidade da Prescriรงรฃo Medicamentosa" references a table with ID and name of the "drug use category",

And "Id do Medicamento" references the table with the drug list.

In the table with the drug list, I have an Id and the corresponding Id to "Id da Finalidade da Prescriรงรฃo Medicamentosa", so they have this in common (which is what I'd like to filter on the dependent dropdown).

I am really sorry if this sounds confusing, guys! 

Thanks for the help!



 

Solved Solved
0 3 168
1 ACCEPTED SOLUTION

Alright, guys... for anyone interested in how this works. I got it!

I had to make a few changes in order for it to work.

This is my data structure:

integraOdontoSj_0-1686945824563.png

The category is number 4 and the item related to the category is number 5. They were Ref, since each category had its own Id and each item also had its own Id. Both of them also had their own tables.

I removed the table of the "category" items, and just wrote down the categories in the place of its former Id Value in the item table.

After that, I have changed the data type do "Enum", and wrote this formula in the "Valid If" field:

integraOdontoSj_1-1686945992968.png


Basically, what you put in the "Valid If" field is the table and column of values you want it to display as the inputs in your Enum. (works the same as if you put it as Ref type of data, but Ref gives you back the ID's of the items in the table. With the "Valid If" method, it will give you the values in the column you assigned it.

I then did the same in the column 5 of my table, which is for the item i wanted to reference with the category. (I think it's important to note that both of the category and item are in the same Table).

Here it is:

integraOdontoSj_2-1686946247422.png


The only problem I have found with this is that the items that appear to me with the dependent dropdown working are the name of the drugs I am to prescribe, not the Id displaying the label of the item. The best case scenario here would be to retrieve the IDs and have it displayed as the respective ID's labels. But it does not work. 

If in the "Valid If" field I write the table and column of the ID of the item I want, it will not display the Label of the ID, just the letters and numbers, which sucks.

I hope this helps someone desperate in need of understanding how this works, like I was.

If anyone knows how to use the ID instead of the name of the item, I'd be glad to know a workaround that!!

Peace!!

 

View solution in original post

3 REPLIES 3

Thanks for the link, mate, however, the example he gives is different from what I need. There is one barcode for each item. What I want would be if one barcode was associated with multiple items, and once you select that barcode, the next dropdown would be with the items that have that same barcode. (like continents and countries, in other examples we see online).

Also, appsheet has videos of dependent dropdowns in videos that are 7 and 5 years old...

Much has changed, especially the UI, making it harder to follow. 

Alright, guys... for anyone interested in how this works. I got it!

I had to make a few changes in order for it to work.

This is my data structure:

integraOdontoSj_0-1686945824563.png

The category is number 4 and the item related to the category is number 5. They were Ref, since each category had its own Id and each item also had its own Id. Both of them also had their own tables.

I removed the table of the "category" items, and just wrote down the categories in the place of its former Id Value in the item table.

After that, I have changed the data type do "Enum", and wrote this formula in the "Valid If" field:

integraOdontoSj_1-1686945992968.png


Basically, what you put in the "Valid If" field is the table and column of values you want it to display as the inputs in your Enum. (works the same as if you put it as Ref type of data, but Ref gives you back the ID's of the items in the table. With the "Valid If" method, it will give you the values in the column you assigned it.

I then did the same in the column 5 of my table, which is for the item i wanted to reference with the category. (I think it's important to note that both of the category and item are in the same Table).

Here it is:

integraOdontoSj_2-1686946247422.png


The only problem I have found with this is that the items that appear to me with the dependent dropdown working are the name of the drugs I am to prescribe, not the Id displaying the label of the item. The best case scenario here would be to retrieve the IDs and have it displayed as the respective ID's labels. But it does not work. 

If in the "Valid If" field I write the table and column of the ID of the item I want, it will not display the Label of the ID, just the letters and numbers, which sucks.

I hope this helps someone desperate in need of understanding how this works, like I was.

If anyone knows how to use the ID instead of the name of the item, I'd be glad to know a workaround that!!

Peace!!

 

Top Labels in this Space