Select to view content in your preferred language

Change Date to Text in Survey123 Feature Report

982
7
Jump to solution
05-04-2023 08:28 AM
StevenHughes44
Emerging Contributor

I have built a feature report based on Survey123 data and need to change a date to text based on the year of the date.  If the date has a year of 9999, I want to replace the full date with text.  Is this something that is possible?

0 Kudos
1 Solution

Accepted Solutions
BarbaraWebster1
Esri Regular Contributor

Hi @StevenHughes44,
You could do this by using a conditional report element and the format method to return the year.

For example:

${if (date1 |format:”YYYY”)==”9999”}

A year of 9999 was entered.

${/}


Thanks,
-Barbara

View solution in original post

0 Kudos
7 Replies
BarbaraWebster1
Esri Regular Contributor

Hi @StevenHughes44,
You could do this by using a conditional report element and the format method to return the year.

For example:

${if (date1 |format:”YYYY”)==”9999”}

A year of 9999 was entered.

${/}


Thanks,
-Barbara

0 Kudos
StevenHughes44
Emerging Contributor

Thank you for your help on this.  When I use the element as written, I get an error stating the the end tag is unopened.  If I load the template without the end tag, the report does generate with the element result of this: 

StevenHughes44_0-1683295071145.png

 

0 Kudos
BarbaraWebster1
Esri Regular Contributor

@StevenHughes44 Can you provide the report template and XLSForm you're using?

0 Kudos
StevenHughes44
Emerging Contributor

I have attached the Word template for this feature report.

0 Kudos
BarbaraWebster1
Esri Regular Contributor

@StevenHughes44 Thanks for sending the template. It looks like you're missing a space after the "if".

0 Kudos
StevenHughes44
Emerging Contributor

Adding the space has fixed the issue.  What would I need to update in the element so this is shows a date that is not equal to "9999"?

0 Kudos
BarbaraWebster1
Esri Regular Contributor

Glad that worked! The operator for not equals is '!='. There is also a table in the Survey123 Report template documentation that includes all the operators you can use for a conditional section.

0 Kudos