Select to view content in your preferred language

Attribute Assistant: Help using the expression method

3622
5
Jump to solution
03-14-2014 07:25 AM
Labels (1)
MikeOnzay
Regular Contributor
I want to populate the value in the field "description" when the value in "diameter" is created or changed.

tableName - water_pipes
fieldName - description
valueMethod - expression
valueInfo - IIF([DIAMETER] >=16, "250")
onCreate - True
onChange (attribute) - True
onChange (geometry) - false
manualOnly - False

I've tried both creating a new feature and changing the value of an existing feature attribute but this expression is not working.
Any ideas? I've looked through the forum and found much more complicated expressions that this seems simple in comparison.
0 Kudos
1 Solution

Accepted Solutions
MikeOnzay
Regular Contributor
The solution is that the IIF operator requires 3 arguments. My expression should have been written as

IIF([DIAMETER] >=16, "250", NULL)

ESRI tech support helped me understand I needed the 3rd argument. It was actually very helpful to know this because it meant that I could write the expression as: IIF([DIAMETER] >=16, "250", "350"). If the pipe diameter is greater or equal to 16 then populate the  description field as "250" otherwise populate the description field as "350". It saved me from need adding a second expression record in the dynamic table.


The example on this page has a good description:
http://msdn.microsoft.com/en-us/library/27ydhh0d(v=vs.90).aspx

I want to populate the value in the field "description" when the value in "diameter" is created or changed.

tableName - water_pipes
fieldName - description
valueMethod - expression
valueInfo - IIF([DIAMETER] >=16, "250")
onCreate - True
onChange (attribute) - True
onChange (geometry) - false
manualOnly - False

I've tried both creating a new feature and changing the value of an existing feature attribute but this expression is not working.
Any ideas? I've looked through the forum and found much more complicated expressions that this seems simple in comparison.

View solution in original post

0 Kudos
5 Replies
RobertBorchert
Frequent Contributor III
Are there a set number of diameters?

If so you should create a subtype of the diameters.  Enter the values for the Diameter as you create the different subtypes.

Then in the dialog below the subtypes are your different attributes.  When you select your first diameter (in the subtype dialog) go to the attribute and fill in the default value for the description.

You can do this for each subtype.

I want to populate the value in the field "description" when the value in "diameter" is created or changed.

tableName - water_pipes
fieldName - description
valueMethod - expression
valueInfo - IIF([DIAMETER] >=16, "250")
onCreate - True
onChange (attribute) - True
onChange (geometry) - false
manualOnly - False

I've tried both creating a new feature and changing the value of an existing feature attribute but this expression is not working.
Any ideas? I've looked through the forum and found much more complicated expressions that this seems simple in comparison.
0 Kudos
MikeOnzay
Regular Contributor
No. Right now this is a simple test to see if I can get this to work. There are no subtypes or domains on these fields. The diameter field has a type of double. The description field has a field type of text, length=60.

Are there a set number of diameters?

If so you should create a subtype of the diameters.  Enter the values for the Diameter as you create the different subtypes.

Then in the dialog below the subtypes are your different attributes.  When you select your first diameter (in the subtype dialog) go to the attribute and fill in the default value for the description.

You can do this for each subtype.
0 Kudos
RobertBorchert
Frequent Contributor III
Let me rephrase it.

Will there be a set number of diameters?
0 Kudos
MikeOnzay
Regular Contributor
Yes. The diameter will be constrained by a range domain.

Let me rephrase it.

Will there be a set number of diameters?
0 Kudos
MikeOnzay
Regular Contributor
The solution is that the IIF operator requires 3 arguments. My expression should have been written as

IIF([DIAMETER] >=16, "250", NULL)

ESRI tech support helped me understand I needed the 3rd argument. It was actually very helpful to know this because it meant that I could write the expression as: IIF([DIAMETER] >=16, "250", "350"). If the pipe diameter is greater or equal to 16 then populate the  description field as "250" otherwise populate the description field as "350". It saved me from need adding a second expression record in the dynamic table.


The example on this page has a good description:
http://msdn.microsoft.com/en-us/library/27ydhh0d(v=vs.90).aspx

I want to populate the value in the field "description" when the value in "diameter" is created or changed.

tableName - water_pipes
fieldName - description
valueMethod - expression
valueInfo - IIF([DIAMETER] >=16, "250")
onCreate - True
onChange (attribute) - True
onChange (geometry) - false
manualOnly - False

I've tried both creating a new feature and changing the value of an existing feature attribute but this expression is not working.
Any ideas? I've looked through the forum and found much more complicated expressions that this seems simple in comparison.
0 Kudos