Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Issue with Record Producer Draft Behavior After Variable Restructuring (Load Draft Widget)

Dikshya
Tera Contributor

Context

We are using a custom Load Draft widget for a Intake Form, where users can use saved reload drafts instead of filling the entire form.

As part of a recent enhancement story, we made the following changes:

  • Removed / inactivated some Data Use (DU) questions for Expansion request path
  • Renamed and renumbered some of the remaining DU questions
  • Inactivated the old RBI.7 question from the Request Background section
  • Moved D10, which was earlier under the Data section (New Functionality request path), into the Request Background section
  • Reused D10 as the new RBI.7 (renamed accordingly)
  • Updated request path variable choice list, renamed Expansion of data use to Expansion

After this, the draft functionality is not working as expected. If we are using any existing old drafts then for request path variable it is not taking any input for other variables in upper sections it is populating. 

Technical Observation

In the Load Draft widget, draft values are restored using:

 

 
JSON.parse(draft.payload.value).forEach(function (variable_obj) {
$scope.page.g_form.setValue(
variable_obj.variable_name,
variable_obj.stagedValue
);
});
 

So:

  • Draft loading is based on variable_name
  • Old drafts still contain values for variables that:
    • were removed
    • were moved
    • or replaced by new variables (with different sys_ids)

Previously also, we had:

  • Inactivated multiple variables
  • Removed some questions

But at that time, we did not face any issues with draft loading

This makes it unclear why the current changes are impacting drafts more broadly.

0 REPLIES 0