Select to view content in your preferred language

Default value if value = null

1559
4
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

4 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?

0 Kudos