web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Updating Various Field...
Power Apps
Unanswered

Updating Various Fields Based on 1 Selection

(0) ShareShare
ReportReport
Posted on by 20

I have a SharePoint list as my data source. I am trying to have it so that if the person, enters a new record or updates an existing record, selects “Free” from a list in the R-Payment-Method field (this is a choice field), that it then sets:

  • the R-Cost Center/GL Number field to “NA”
  • the R-Ad-Posting-Cost field to 0.00
  • the Billing Status field to “Free” (this is choice field)

If something else is selected in the R-Payment-Method field then it should allow the user to select/enter other things in the fields. I keep getting a Network error when using patch function.

I have been trying to set the R-Payment-Method field’s OnChange property to the code below:

Patch(

    'Demo Ad Log', Defaults('Demo Ad Log'),

    If(

        DataCardValue45.Selected.Value = "Free",

        {

            'R-Cost Center/GL Number': "NA",

            'R-Ad-Posting-Cost': "0.00",

            'Billing-Status': {Value: "Free"}

        }

    )

)

What am I doing wrong here?

Thanks

Nick555_0-1692731717493.png

 

Categories:
I have the same question (0)
  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at
    Re: Updating Various Fields Based on 1 Selection

    Hi @Nick555,

     

    With the current code you are trying to create a new record in the SharePoint list with those values and it is missing the required Title field. I think the best approach would be only changing those values when "Free" is selected and the user submits the Form.

     

    The code below will assume that you are using SubmitForm to patch the data to SharePoint.

     

    (1) Change the Cost Center TextInput (DataCardValue) Default property to:

    If(DataCardValue45.Selected.Value = "Free", "NA", Parent.Default)

     

    (2) Change the Posting Cost DataCardValue Default property to:

    If(DataCardValue45.Selected.Value = "Free", 0, Parent.Default)

     

    If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

    Thanks!

  • Nick555 Profile Picture
    20 on at
    Re: Updating Various Fields Based on 1 Selection

    Yes, it does! Thank you very much!!!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 757 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 322 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 209 Super User 2025 Season 2

Last 30 days Overall leaderboard