ArcGIS Pro Task - checking mandatory field

1745
7
Jump to solution
01-03-2020 06:17 AM
SreenivasaRaoPigili
Occasional Contributor

Hi Jason Camerano, Amir Bar-Maor,

    I am going through your ArcGIS Pro Task explanatory videos. Can you please help me in below two situations.

1. How can we make Field as mandatory field - using Tasks.(i hope you are not using attribute rules/ making field as non-nullable field)

(ArcGIS Pro Tasks: An Introduction - YouTube     : Screen at 34.43sec)

2. How can we validate topology rules on polygons

(Creating and Managing GIS Data: ArcGIS Pro Tasks: An Introduction - YouTube  : screen at 46.57Sec)

Thank you in advance.

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
JasonCamerano
Esri Contributor

Hey srinu rao

I think the time stamps provided might be a little off from the video but I think I know how to answer your questions. 

1. To prevent a user from moving form one step to another until they properly attribute a field of a feature or features you can use the Verify step action.  Here's the documentation on how to validate in Tasks: Verify step actions—ArcGIS Pro | ArcGIS Desktop 

2. In the step where I validate the topology I created a Step Palette Create a palette—ArcGIS Pro | ArcGIS Desktop  and one of the steps in the palette was "Validate Extent".  I chose a step palette because there are many tools that the user could use to fix the topology errors and I wanted to provide them in the palette.  They could click Validate Extent (the first tool in the palette) at any point and it would validate the extent. 

Hopefully his answers your questions!

Thanks,

Jason

View solution in original post

7 Replies
JasonCamerano
Esri Contributor

Hey srinu rao

I think the time stamps provided might be a little off from the video but I think I know how to answer your questions. 

1. To prevent a user from moving form one step to another until they properly attribute a field of a feature or features you can use the Verify step action.  Here's the documentation on how to validate in Tasks: Verify step actions—ArcGIS Pro | ArcGIS Desktop 

2. In the step where I validate the topology I created a Step Palette Create a palette—ArcGIS Pro | ArcGIS Desktop  and one of the steps in the palette was "Validate Extent".  I chose a step palette because there are many tools that the user could use to fix the topology errors and I wanted to provide them in the palette.  They could click Validate Extent (the first tool in the palette) at any point and it would validate the extent. 

Hopefully his answers your questions!

Thanks,

Jason

AmirBar-Maor
Esri Regular Contributor

With Attribute Rules Constraint you can prevent a feature creation that does not meet an expression evaluation (for example - must not be NULL).

With Tasks you can achieve a similar behavior by adding a versification action and a SQL quesry as Jason Camerano‌ is pointing out. This will prevent the user from proceeding to the next step if the selection (based on attribute SQL query expression) is not met. For example you can try to select the cases that you don't want to see and make sure the number of selected features is equal to zero. 

ChaimSchwartzIroads
New Contributor III

Hello @AmirBar-Maor 

I am trying to configure a mandatory text field using an ArcGIS Pro constraint rule, configured as an "INSERT" rule. However, I'm encountering the following issue: When digitizing a new linear feature, the digitizing fails because...the mandatory field is still empty. But then of course it's empty just because it has just been created.  Is there any way to bypass this conundrum?

 

0 Kudos
AmirBar-Maor
Esri Regular Contributor

@ChaimSchwartzIroads 

As you have found out, Attribute Rules constraints do precisely what their name suggests  🙂

Here are a few options to explore:

1. If you use editor tracking, you can use the creation time to skip checking the feature if it has been created in the last few seconds. Here is a code sample you might adjust for a similar case:

 

 

//Setting: If your data was migrated on June 18th 2019, you should add 2 days (June 20th) to avoid time rounding issue.
var MigrationDate = Date(2019,05,20); //Note: the month count starts at zero. year 2019, month of JUNE, 20th day. 
var CreationDate = Date($feature.Create_Date);
if (DateDiff(CreationDate, MigrationDate, 'days') > 0){
    return !IsEmpty($feature.CreatedByRecord);
}
return true;

 

 

 

2. You can set the default value of the field to a value and use the Arcade logic to ignore that value. That is not that good though, as there's no difference between this value and 'NULL'

3. Switch the rule to Validation Rule instead of the constraint rule. In many editing workflows features exist in an interim state, before they get planarized, merged etc. So it is easy to catch errors upon validation versus creation.

4. Use Task verification. It is not stored in the information model. The caveat is that the user must use the task. Any edits outside of a task will not be captured.

ChaimSchwartzIroads
New Contributor III

Thank you @AmirBar-Maor 

Option number 4 is probably the route we'd need to go. I will shortly relate to the other options that you suggested, just to make sure I have correctly understood you:

Option #1: If the INSERT rule will be skipped during creation, then basically there is no scenario where it would be triggered...

Option #2: True...:)

Option #3: We really are looking for a solution that provides immediate constraint. Also, I'm still figguring out if we want to use branch versioning, which to my understanding is a requirement for validation rules.

Thank you!

0 Kudos
AmirBar-Maor
Esri Regular Contributor

Yes - option one is the same as not triggering the rule on 'Insert', only on 'update'. If you can trigger an update after feature creation you'll get the same result.

Task verification can be executed on all features that were created during the task execution and prevent the user from proceeding to the next step if any of verifications fail.

ChaimSchwartzIroads
New Contributor III

Thank you. That's what we've settled down to do at this time. It's pretty amazing that there isn't a fool-proof method to require a mandatory field at the geodatabase level, when digitizing a new feature. I actually found a very similar request by @ModyBuchbinder  here: Define a required field - Esri Community

0 Kudos