You are viewing limited content. For full access, please sign in.

Question

Question

Default value doesnt work when using lookup table

asked on January 12

Hi all,

 

I'm using default value = "mydefaultvalue" on a field B and a lookup table on the same field.

This is is readonly.

 

 

When the lookup table return something, this field B is auto fill.

 

 

But when the lookup table return nothing, the field B is empty and dont return my default value.

 

 

 

0 0

Answer

SELECTED ANSWER
replied on January 12 Show version history

Hi Steve,

 

Thanks for your help.

 

You understood my request.

I never use formula and it looks like mine is not good XD

 

Field "Pays" = var_pays

Field "Pays2" = var_pays2

 

 

 

If the lookup return something, then my field "Pays2" is populated.

I changed to this code

=IF(LEN(var_pays)=0,"test",var_pays)

and it's working.

 

Thanks a lot.

Regards

1 0

Replies

replied on January 12

Hi Olivier

Is Nom de la Societe your lookup field, and it populates the Pays field?

What you are saying is that you have assigned a default value to the Pays field and what you are looking for is that if the Lookup doesn't return a value then you want it to populate the default value "Polynese Francaise"?

If this is your request, then I believe you will need to use a different approach. Have the lookup populate the Pays field "hide this field (Always) Set Save the Data.

Create a new Pays field (Variable could be PaysDisplay). Put an IF formula in the field, =IF(PaysLookup Field="","Polynese Francaise",PaysLookup Field)

0 0
SELECTED ANSWER
replied on January 12 Show version history

Hi Steve,

 

Thanks for your help.

 

You understood my request.

I never use formula and it looks like mine is not good XD

 

Field "Pays" = var_pays

Field "Pays2" = var_pays2

 

 

 

If the lookup return something, then my field "Pays2" is populated.

I changed to this code

=IF(LEN(var_pays)=0,"test",var_pays)

and it's working.

 

Thanks a lot.

Regards

1 0
replied on January 12

Forms Calculations run very close to what you would expect from excel

Did you use the > to populate your variables. If the Field doesn't appear under the >, refresh your page to ensure the variable is created.

0 0
replied on January 12

This is resolved. I changed my formula.

 

This one didn't work

=IF(var_pays="","test",var_pays)

 

But this one works

=IF(LEN(var_pays)=0,"test",var_pays)

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.