Good morning friends! I'm building a PTO Power App, and I've created a list that stores records of employee's available PTO seperated by type. The idea is that the user can select an option from a choice form, and depending on the selection two variables will be updated; one as a string, and one as the number. I've created a switch that should handle this, but when an option is selected the value returns as blank. Earlier in the form, I reference the column value via lookup in a gallery and it works fine, so I'm assuming it's just bad code on my end. Can anyone help? For reference, the VacationDaysCurrent/PersonalDaysCurrent are the columns in the list.
I've tried referencing the columns as ThisItem.VacationDaysCurrent, VacationDaysCurrent.Value, and just VacationDaysCurrent, and using ThisItem format at least doesn't error out, but returns a blank value. I currently have it set as a Text label where SelectedTimeOffAvailableDays is the Text, and still no value is being returned.
Switch(
DataCardValue22.Selected.Value,
"Vacation",
Set(SelectedTimeOff, "Vacation");
Set(SelectedTimeOffAvailableDays, ThisItem.VacationDaysCurrent),
"Personal",
Set(SelectedTimeOff, "Personal");
Set(SelectedTimeOffAvailableDays, ThisItem.PersonalDaysCurrent),
"Holiday",
Set(SelectedTimeOff, "Holiday");
Set(SelectedTimeOffAvailableDays, ThisItem.HolidayDaysCurrent),
"Health & Wellness",
Set(SelectedTimeOff, "Health & Wellness");
Set(SelectedTimeOffAvailableDays, ThisItem.HealthAndWellnessDaysCurrent),
"Carry Over",
Set(SelectedTimeOff, "Carry Over");
Set(SelectedTimeOffAvailableDays, ThisItem.CarryOverDaysCurrent),
Set(SelectedTimeOff, "");
Set(SelectedTimeOffAvailableDays, 0)