Skip to main content

Notifications

Power Apps - Microsoft Dataverse
Answered

Patching Radio Buttons

(0) ShareShare
ReportReport
Posted on by 239

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

Categories:
  • AhmedSalih Profile Picture
    AhmedSalih 6,678 on at
    Re: Patching Radio Buttons

    @gfeldhake, Happy to help 🙂

  • GF-02121351-0 Profile Picture
    GF-02121351-0 239 on at
    Re: Patching Radio Buttons

    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
     }
     )
    )
  • Verified answer
    AhmedSalih Profile Picture
    AhmedSalih 6,678 on at
    Re: Patching Radio Buttons

    @gfeldhake, PM me a Teams invitation and I can take a look. 

  • GF-02121351-0 Profile Picture
    GF-02121351-0 239 on at
    Re: Patching Radio Buttons

    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. 

  • AhmedSalih Profile Picture
    AhmedSalih 6,678 on at
    Re: Patching Radio Buttons

    @gfeldhake so the amount we pay out (cost) are choices in Dataverse table?

  • GF-02121351-0 Profile Picture
    GF-02121351-0 239 on at
    Re: Patching Radio Buttons

    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? 

  • AhmedSalih Profile Picture
    AhmedSalih 6,678 on at
    Re: Patching Radio Buttons

    @gfeldhake , are you saving those values in a a column using Choices in Dataverse?Lunch: Noon-2PM

     

     

  • GF-02121351-0 Profile Picture
    GF-02121351-0 239 on at
    Re: Patching Radio Buttons

    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. 

  • AhmedSalih Profile Picture
    AhmedSalih 6,678 on at
    Re: Patching Radio Buttons

    @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


     

     

  • GF-02121351-0 Profile Picture
    GF-02121351-0 239 on at
    Re: Patching Radio Buttons

    I think that will work. 

     

    I did get this error when I made the change: 

    Type Error.png

    crae8_cost is set as a decimal in my Dataverse table. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,666

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,996

Leaderboard

Featured topics