I have a Ref row, and due to security filters now only 1 options is available. I really need this to be the initial value, so my clients don’t have to keep clicking it everytime they have to fill out a form.
If you can guarantee there will only ever be one option as a result of security filters, you can use ANY() to default to that value.
ANY(reftable[refcolumn])
It works for me
@Jonathon
I am trying to accomplish something similar. In my case I want to limit the ref column to a specific value and set the dropdown automatically. when another field is set to NO. It works except that the user has to select the value from the dropdown.
VALID_IF
INTIAL VALUE
Hey James,
Your initial value formula does not consider the list from your valid_if statement - it is still trying to pick ANY() value from the entire v_aseguradoras table. However, the value it is trying to select is likely failing your valid_if statement so it is turning up blank.
Your initial value formula will need to be a SELECT() statement that matches the valid_if statement.
Hi Jonathon,
I set the VALID_IF:
IF([Cubierto_por_ARSs]=False, ORDERBY( SELECT(v_Aseguradoras[Codigo_SAIL],[Codigo_SAIL]=0) ,[Nombre]), ORDERBY(v_Aseguradoras[Codigo_SAIL],[Nombre]) )
Need help with the Intial Value:
if([Cubierto_por_ARSs]=False,
SELECT(v_Aseguradoras[Codigo_SAIL],[Codigo_SAIL]=0,true),
ANY(v_Aseguradoras[Codigo_SAIL])
)
If [Cubierto_por_ARSs]
is FALSE, then there should only be one possible value, which is identified by [Codigo_SAIL]=0
Is this correct?
Yes that is correct it is correct. If it is false then dropdown value should be set to 0 and if Cubierto_Por_ARS is True then the user should be able to select from a list of values.
Valid IF:
[Cubierto_por_ARSs]=False
to simply [Cubierto_por_ARSs]
, and reordering IF()
expression. The [Cubierto_por_ARSs]
column is already a T/F value, so you don’t need to re-evaluate it.[Cubierto_por_ARSs]
is FALSE, we expect a single value (0)
. Therefore, the ORDERBY() expression is not necessary.The simplified expression is:
IF([Cubierto_por_ARSs],
ORDERBY(v_Aseguradoras[Codigo_SAIL],[Nombre]),
SELECT(v_Aseguradoras[Codigo_SAIL],[Codigo_SAIL]=0)
)
Initial Value:
[Cubierto_por_ARSs]
column.The simplified expression is:
IF([Cubierto_por_ARSs],
"",
"0"
)
If the value is NOT known, then you could write:
IF([Cubierto_por_ARSs],
"",
ANY(SELECT(v_Aseguradoras[Codigo_SAIL],[Codigo_SAIL]=0))
)
Jonathon,
Man thanks for all the help I really appreciate it. But it is still not working. The column is a ref column.
Hey James;
Unfortunately I don’t think I have enough information to troubleshoot this further for you. If you shared editor access to me at redacted, I could likely find the issue.
shared
"Ok Google,
Remind me tomorrow at 9am to help James McFarlane with his AppSheet app"
Where are you located, time zone?
CST - It’s 6:40pm here currently.
It is 8:39 here. I am int EST.
Testing some things right now.
me too. let me stop.
James, I believe it is fixed now. The current behaviour as follows:
[Cubierto_por_ARSs]
column: TRUE, FALSE, or NULL.
Is this correct?
Yes that is the desired effect.
Okay - feel free to revoke my editor access.
The problem was your initial value was referencing the ‘Privado’ text instead of its paired key value of ‘0’. When dealing with REF columns, you have to target the parent / child records key column.
IF([Cubierto_por_ARSs],
"",
"0"
)
In the above, it is basically saying:
If [Cubierto_por_ARSs] is True, then leave the value blank, otherwise populate it with ‘0’ which is associated to ‘Privado’
so that is why I have been needing to do the if, because of the null. Will have to go in the DB and set some default values to CERO.
Thank you very. I tried with the 0 and left it with ‘Privado’. You are awesome!
User | Count |
---|---|
18 | |
11 | |
11 | |
8 | |
4 |