Hello,
I'm trying to create a collection that grabs a text value, a date value, a choice value, and then two number values. I am unable to get the DateValue to work appropriately with the Patch Statement.
Collection Creation:
NewForm(NewInsLot); ClearCollect(InspectionCollection, {InsLot: "", ShiftDate: 0, Shift: InputShift.Selected.Value, CompletedUnits: 0, UnitsRemain: 0});Navigate(CreateNewInspectionLot)
Patch:
Patch(InspectionCollection, ThisItem, {InsLot: InputInsLot.Text, ShiftDate: DateValue(InputShiftDate.Text), Shift: InputShift.Selected.Value, CompletedUnits: Value(InputCompleteUnits.Text), UnitsRemain: Value(InputUnitsRemain.Text)});
Thanks for your input!
Solved! Go to Solution.
hi @crjwarre the input.text should work if the format complies.
all of the labels below use the function DateValue(TextInput1_1.Text,"en-US")
if the format of the date is wrong it will give an error.
hi @crjwarre in the collection the date is set as number, patching it will be a mismatch. you can get the collection to accet the date as a number and must convert it again to date or you can just change the Shiftdate to have a date as default in the collection as today() and all will be sorted
{InsLot: "", ShiftDate: 0, Shift:
Hope it helps
The Collection as today() worked, but how would that change my patch statement?
ShiftDate: DateValue(InputShiftDate)
this nor .Value or .Text worked.
hi @crjwarre the input.text should work if the format complies.
all of the labels below use the function DateValue(TextInput1_1.Text,"en-US")
if the format of the date is wrong it will give an error.