Announcements
This site is in read only until July 22 as we migrate to a new platform; refer to this community post for more details.

Initial value from a REF table

Hey guys. I'm Brazilian, sorry if my English isn't correct.

I'm new to AppSheet, forgive me if I'm being silly.

I've tried every way, but I couldn't.

When registering, I want a drop-down list to appear to choose the category. I was able to do this with a REF table.

I also want to define an initial value based on the drop-down list. I've already tried ANY, LOOKUP, SELECT.

I can even set text as an initial value, but it returns an exclamation point. I notice that a new category is created, so I need to choose from the existing categories.

I feel like it's such a simple formula, but I've felt so failed with it.

What's the solution, friends?

Thanks.

Solved Solved
0 6 1,060
1 ACCEPTED SOLUTION

Ok, got it. Is your data stored in an Appsheet database or Google Sheet? Does your CatFinanc table have a key column? It should be this:

ANY(SELECT(CatFinanc[KeyColumnName], [Categoria] = "Propaganda"))

 

View solution in original post

6 REPLIES 6

You are indicating that you are selecting from a dropdown for a reference column. If you are allowing new entries in this dropdown, the exclamation mark shows up because the selected entry does not exist in the table your dropdown is referencing.

Iit is unclear what you are trying to accomplish by setting an initial value. If you choose the 'ADD' button under the Inline View of the reference record, then your initial value should automatically be set. If you have a custom action with LINKTOFORM() then you have to set a value within that formula. If you are just opening a form from your child table then you have to manually set the REF in the dropdown because there really is no way of figuring out what the initial value should be.

DropDown2.jpgDropDown1.jpgFirstly, thank you for trying to help me. Sorry if I wasn't so clear.

I have a table where I register the categories. I use this table as REF in registration table.

When registering, the category field appears as a drop-down menu and is working correctly. The more than ten categories are appearing perfectly.

My need is that when registering, a specific category appears as the initial value. The application user can choose another category, but in this case it is important to have a category already pre-selected.

Currently, my app returns the category field blank and the user needs to choose.

Is there any way to choose a category from the list automatically?

Thanks.

It certainly is possible, however which category should be preselected? Is it always the same or does it depend on the user? A suggestion below:

ANY(YourReferenceTableName[YourRefTableKeyColumnName])

I keep racking my brain, my friend.

I need to pre-select a specific category:
'Propaganda'form select.jpgReturn.jpgcomport.jpg

It is already created, but the formula is creating a new one. I couldn't do it using the ANY formula.

Thanks.

Ok, got it. Is your data stored in an Appsheet database or Google Sheet? Does your CatFinanc table have a key column? It should be this:

ANY(SELECT(CatFinanc[KeyColumnName], [Categoria] = "Propaganda"))

 

Friend, I've been trying for hours.

You pointed me to the correct path. By the way, I'm using a cloud database (Google sheets)

Thanks.

Top Labels in this Space