Hi,
I have a Travel Reimbursement app that I am working on and am having a hard time getting the meals patch to work.
I keep getting the error "Expected Boolean"
I am trying to have the cost column value update based on what is selected.
If(MealOpt.Selected.Value = "Breakfast: 6AM-8AM", Patch('TR Expenses', LookUp('TR Expenses', TravelID),{Cost: "$6.00",}),
MealOpt.Selected.Value = "Lunch: Noon-2PM", Patch('TR Expenses', LookUp('TR Expenses', TravelID),{Cost: "$11.00",}),
MealOpt.Selected.Value = "Dinner: 6PM-8PM", Patch('TR Expenses', LookUp('TR Expenses', TravelID),{Cost: "$19.00",}),
MealOpt.Selected.Value = "All 3 Meals: 6AM-8PM", Patch('TR Expenses', LookUp('TR Expenses', TravelID),{Cost: "$36.00",})
)
Thank you
Thank you so much for helping me fix my code.
If(
MealOpt.Selected.Value = "Breakfast: 6AM-8AM",
Patch(
'TR Expenses',
Defaults('TR Expenses'),
{
Name: Text("Test"),
TravelID: TravelSelection,
Cost: 6.00
}
),
MealOpt.Selected.Value = "Lunch: Noon-2PM",
Patch(
'TR Expenses',
Defaults('TR Expenses'),
{
Name: Text("Test"),
TravelID: TravelSelection,
Cost: 11.00
}
),
MealOpt.Selected.Value = "Dinner: 6PM-8PM",
Patch(
'TR Expenses',
Defaults('TR Expenses'),
{
Name: Text("Test"),
TravelID: TravelSelection,
Cost: 19.00
}
),
MealOpt.Selected.Value = "All 3 Meals: 6AM-8PM",
Patch(
'TR Expenses',
Defaults('TR Expenses'),
{
Name: Text("Test"),
TravelID: TravelSelection,
Cost: 36.00
}
)
)
No, it is for any amount that an employee need reimbursed for.
Meals are weird because regardless of how much was spent, we are only permitted to pay out a certain amount based on the length of travel.
@gfeldhake so the amount we pay out (cost) are choices in Dataverse table?
No, only the amount we pay out (cost) when travel occurs during that time. On a different screen they input their start and end time.
Do you think I should?
I am starting to wonder if I need to start over and research Radio buttons and If statements more.
I am now getting invalid argument type Boolean. Expecting a record value instead.
@gfeldhake, use the numbers in your Patch functions without double quotations and without dollar sign $.
If my reply helped you, please give a 👍 , & if it solved your issue, please 👍 & Accept it as the Solution to help other community members find it more. I am primarily available on weekdays from 6-10 PM CT and 5-10 PM CT on weekends. Visit my Blog: www.powerplatformplace.com
|
I think that will work.
I did get this error when I made the change:
crae8_cost is set as a decimal in my Dataverse table.