Hello,
Here’s a formula for the
OnSelect
property of the submit button that handles the object creation logic:
// Extract month and year from DatePicker1
Set(SelectedMonth, Month(DatePicker1.SelectedDate));
Set(SelectedYear, Year(DatePicker1.SelectedDate));
// Extract day, month, and year from DatePicker2
Set(SelectedDay, Day(DatePicker2.SelectedDate));
Set(SelectedFullMonth, Month(DatePicker2.SelectedDate));
Set(SelectedFullYear, Year(DatePicker2.SelectedDate));
// Create object in the Appareil table
Patch(
Appareil,
Defaults(Appareil),
{
AppareilName: TextInput1.Text,
Description: TextInput3.Text,
MonthYear: DateValue(SelectedMonth & "/01/" & SelectedYear) // Example format for Month and Year
}
);
// Create object in the Activité table
Patch(
Activité,
Defaults(Activité),
{
ActivitéName: TextInput2.Text,
EventDate: DateValue(SelectedFullMonth & "/" & SelectedDay & "/" & SelectedFullYear) // Example format for full date
}
);