You can copy a form's rules into another form instead of rebuilding them by hand. Copying works for every rule type on the Rules tab: auto-tag rules, auto-decision rules, auto-revoke (offer expiration) rules, and Connect Forms rules.
There are two ways to copy rules:
- From an existing form: copy rules from another form in your organization, in any enrollment period.
- With a JSON file: export a form's rules to a file, then import that file into another form. Use this to move rules to a different organization or environment.
Typically, you may want to copy rules when:
- Setting up next year's enrollment period with the rules you refined this year
- Opening an additional round mid-year
- Creating a separate version of a form for a specific group, such as employee children or early childhood applicants
Before you start
Check your rule keys
Each rule has a Rule key that identifies it when you copy. A copied rule updates the rule with the same key in the destination form. If no rule has that key, a new rule is created.
- The key fills in automatically from the rule name as you type. You can edit it.
- Each key must be unique within a form.
- Connect Forms rules don't have a key, because a form can have only one.
- You can only copy rules into a Form that hasn't been published yet.
If you open a rule that doesn't have a key yet, a key is filled in for you. Click Save to keep it.
[IMAGE: Rule drawer showing the Rule key field below the rule name]
Make sure the destination form has what your rules use
Rules point to schools, questions, answer options, grades, and boundaries. When you copy, each rule looks for a match in the destination. If a match is missing, that rule isn't imported, and you see an error that names what's missing.
| Rules that use | Are matched by |
|---|---|
| Schools | School reference ID |
| Questions | Question key |
| Answer options | Answer option key |
| Grades | Grade key |
| Boundaries | Boundary key |
| Connected form (Connect Forms rules) | Form key, in the destination enrollment period |
Tags: if a rule uses a tag that doesn't exist in the destination enrollment period, the tag is created for you. If a tag with the exact same name already exists, the rule uses it.
Copy rules from another form
Use this to copy rules between forms in the same organization, including forms in different enrollment periods.
- Open the form you want to copy rules into, then go to the Rules tab.
- Click Import, then select From existing form. [IMAGE: Import menu open, showing ".JSON file" and "From existing form"]
- In Form to import rules from, search for and select the form to copy from. Each form shows its enrollment period and when it was last modified. [IMAGE: Import rules dialog with the form list open]
- Click Import.
When the import finishes, a toast on the bottom right will read Imported from existing and the rules will appear on the Rules tab. If some rules couldn't be imported, see Fix import and export errors.
Review each imported rule and confirm it's turned on or off the way you want before applications come in.
Export rules to a file & import it elsewhere
Export a form's rules to move them to another organization or environment, or even to just keep a copy.
- Open the form, then go to the Rules tab.
- Click Export JSON.
The file ruleConfiguration.json downloads with all of the form's rules. The file refers to schools, questions, and other items by their keys and reference IDs, so it works in any form that has matching items - it never cdontains UUIDs.
If some rules can't be exported, a toast on the bottom right will read Rules could not be exported and no file will download. See Fix import and export errors. Onc
- Open the form you want to import rules into, then go to the Rules tab.
- Click Import, then select .JSON file.
- Click Import JSON at the top of the editor and choose your file.
- Fix anything the editor underlines. The editor checks the file's format as you work.
- Click Import at the bottom of the page.
Just like when copying form rules from one form to another via the UI, a toast on the bottom right will read Imported from existing and the rules will appear on the Rules tab. If some rules couldn't be imported, see Fix import and export errors.
How imports treat existing rules
Importing doesn't create duplicates, so you can import again after fixing errors.
| If the destination form… | The import… |
|---|---|
| Has a rule with the same key | Replaces that rule with the imported version |
| Has no rule with that key | Adds the rule |
⚠️ A form can have only one Connect Forms rule, so an import can include at most one.
Fix import and export errors
When some rules can't be imported or exported, a red banner appears at the top of the Rules tab.
- Click See details in the banner.
- Review the list. Each failed rule is listed by name, key, and rule type, with the reasons it failed.
- Fix each problem, either in the destination form or in the source rules.
- Import or export again.
Common errors
| Error | What to do |
|---|---|
| A school, question, answer option, grade, or boundary can't be found | Add the missing item to the destination, or make sure its key or reference ID matches the source exactly. |
| A connected form can't be found | Make sure the form the Connect Forms rule points to exists in the destination enrollment period, with the same form key. |
| An item is missing a key | Add a key to that school, question, answer option, grade, boundary, or form, then try again. |
| The key for this rule configuration is not set. | Give the rule a key. |
| Duplicate key "…" | Two rules in the file share a key. Change one of them. |
| Only one ConnectForms rule is allowed. | Remove the extra Connect Forms rule from the file. |
| Invalid input | The rule is missing a required field, or its rule_type is misspelled. Compare it with a freshly exported file. |
| Invalid JSON | The file isn't valid JSON. Check for missing commas, brackets, or quotation marks. |
| JSON is required | Paste or upload a file before you click Import. |
| Something went wrong | Check your connection and try again. If it keeps happening, contact Avela support. |
Comments
0 comments
Article is closed for comments.