How Do I Reference a Field that has the same name as another field? | Community
Skip to main content

How Do I Reference a Field that has the same name as another field?

  • July 14, 2022
  • 2 replies
  • 0 views

CJ99

Hi, I'm trying to report on a field. It was made in 2014, as was an identical field with the same name. These fields are used on two different forms, I do not want to alter the fields in any way if it can be avoided. I do however, want to report on one of them. But when I try to write a formula like this: 


IF [Example Field] = NULL
Then 
"No Value"
ELIF 
[Example Field] != NULL
"Value present"
ENDIF


The problem is, it is picking the wrong field called "Example Field", that isn't even on the form I'm trying to report on. Is there any way to use the custom field number or something to force it to use the right one?

2 replies

Dave12
  • July 15, 2022
Hi CJ, 
 
Here's the relevant info from Reporting with custom fields:
 
  • When multiple custom fields share the same name, issues can occur. If a shared field name is used in a formula, Explore's formula editor always resolves that field as the custom field with that name that was created first. This means you can't create formulas with a custom field that shares the same name as another custom field and was created after the first one. If you have multiple custom fields with the same name, deactivate and delete the one that isn't needed, or rename it.
 
I'll see if we can add warnings to our documentation articles on creating custom fields to make this more visible.

Lou11
  • July 15, 2022

I'm certainly no expert in Explore, but is it possible to use field IDs instead of the names?