Select to view content in your preferred language

Default value if value = null

1641
5
Jump to solution
09-14-2022 08:38 AM
DavidRasner1
Occasional Contributor

Hello,

I was wondering if anyone maybe knows how to format a dynamic text value (attribute) with a default value if empty. I would prefer to do it via UI, not in the DB.

Something like:

If missing then "Missing value"

else {Attribute}

I couldn't find any info on this.

0 Kudos
1 Solution

Accepted Solutions
DanJiang
Esri Contributor

Hi @DavidRasner1 , 

You can use the Expression instead of the Attribute in Dynamic content. Set the expression name as the default value you want and configure the expression content as the attribute. 

DanJiang_0-1663829321155.png

 

View solution in original post

5 Replies
DanJiang
Esri Contributor

Hi @DavidRasner1 , 

You can use the Expression instead of the Attribute in Dynamic content. Set the expression name as the default value you want and configure the expression content as the attribute. 

DanJiang_0-1663829321155.png

 

HowieBrown
New Contributor

This is way past awesome ... I have searched everywhere for this and where to do it. I need this because the First_and_Last_Name field is not mandatory in the survey, but I need the field to have Anonymous in it if they leave it blank - - - The Data base that imports the results can not be null.. Setting it up as a Default would cause problems on the end ...

Anyway - Thank You So Much !!!!!

0 Kudos
DavidRasner1
Occasional Contributor

Ah, thanks!

0 Kudos
AvaPatterson
Occasional Contributor

I tried to do this with a date field I have within a list. I want it to display "Pending" If it's NULL. The populated dates show up but the empty ones still don't show anything. Does this not work on a date field?

LindsayWithers1
Frequent Contributor

I'm having the same problem, but on a numeric field. Did you ever get the Expression name to work for null values on your date field? 

0 Kudos