I'm not sure how, but each write to my Data Source (Sharepoint) is creating a blank record along with the actual records. Maybe you can see where I'm messing up here:
Use Case:
- Offline-capable app (my first!) for simple equipment measurements
- Offline capabilities are not implemented yet.
- OnStart, a hardcoded EquipmentCollection is created of all possible Equipment/Widget combinations (only 😎
- Using a Form control for Error Handling and other things (don't ask 🙂 ), but NOT using SubmitForm()
- Some of the choices require multiple iterations through the Form (tricky)
- Example of tricky-ness:
- User selects "Equipment 12" from Equipment Name dropdown
- The Widget Name dropdown now shows two separate Widgets to inspect for that particular piece of Equipment.
- Both Widgets require the exact SAME measurements to be captured in the Form
Scenarios:
- If Equipment has only 1 Widget (requires 1x Form)
- User clicks Submit
- Collection is created of all Form fields (RecordCollection)
- If CountRows of EquipmentCollection = CountRows of ReadingCollection,
// Show the user that the Widget measurement is "Completed"
Update(EquipmentCollection,
First(
Filter(EquipmentCollection,
equip = EquipmentName.Selected.Value
And widget = WidgetName.Selected.Value
)
),{equip: EquipmentName.Selected.Value, widget: WidgetName.Selected.Value & "-COMPLETED"}
);
// Write the RecordCollection back to the Sharepoint List as a new record
Collect(SharepointListName,
Defaults(SharepointListName),
RecordCollection- If Equipment has 2 Widgets (requires 2x Form)
- User clicks Submit
- Collection is created of all Form fields (RecordCollection)
- If CountRows of EquipmentCollection <> CountRows of ReadingCollection,
- Notify() User that Widget2 needs to be measured
- Reset() Form fields
- Widget1 shows as "Completed" in the dropdown
- User completes measurement of Widget2
- User clicks Submit
- Same code as above runs
// Show the user that the Widget measurement is "Completed"
Update(EquipmentCollection,
First(
Filter(EquipmentCollection,
equip = EquipmentName.Selected.Value
And widget = WidgetName.Selected.Value
)
),{equip: EquipmentName.Selected.Value, widget: WidgetName.Selected.Value & "-COMPLETED"}
);
// Write the RecordCollection back to the Sharepoint List as a new record
Collect(SharepointListName,
Defaults(SharepointListName),
RecordCollectionHa! Feel a little funny writing this all up with no screenshots. Hopefully its clear.
The results is the correct data being written to the Sharepoint List WITH a blank record as well. There is a blank row between every record (whether a single Widget record or 2 Widget record).