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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / OnChange update anothe...
Power Apps
Unanswered

OnChange update another field

(0) ShareShare
ReportReport
Posted on by 7

I have a data entry form based on a SharePoint list.

Issue.JPG

 

'Staff Name' is a Combo box field (office365 users) and 'Issued to OR received from' is a text and a required field. Sometimes we have to issue material to the individuals who are not the organisational staff, hence, the reason for a separate text field.

What I would like to do is, if I select staff from 'Staff Name' field, it should copy the name to the 'Issued to OR received from' field. However, if I leave the 'Staff Name' field blank, I should be able to manually enter name of the individual in 'Issued to OR received from' field.

I have tried the Patch function in the OnChange property of 'Staff Name', while watching Shane Young video, unfortunately it did not work for me. Most probably I did not follow it properly.

Any assistance would be highly appreciated.

Categories:
I have the same question (0)
  • eka24 Profile Picture
    20,923 on at

    You can follow these workaround without using the textbox. That is if the user types in the combobox a name that is not in the list or not, it will be saved:

     

    1. OnStart:

    ClearCollect(MyUsers,Office365Users.SearchUser({searchTerm:""}).DisplayName)

     

    2. On the Items of the ComboBox

    MyUsers

     

    3. If you are using a Patch function:

    Patch(Datasource, Defaults( Datasource),
     { Name: If(IsBlank(ComboBox4.Selected),

    ComboBox4.SearchText,

    ComboBox4.Selected.DisplayName)})

     

    4. If you are using a form, On the Update property:

    If(IsBlank(ComboBox4.Selected),

    ComboBox4.SearchText,

    ComboBox4.Selected.DisplayName))

     

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • MarcelLehmann Profile Picture
    378 on at

    I would use the fur the text field the displaymode'if(IsBlank(ComboBox4.Selected),edit,view)' and for the default text it this 'ComboBox4.Selected.DisplayName)'

  • eka24 Profile Picture
    20,923 on at

    If the issue Resolved?

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • tmawan Profile Picture
    7 on at

    @eka24, thanks a lot for taking time to respond to my query, appreciated.

     

    StaffName (Combo Box) is not a required field, "Issued to or received from" text box is a required field, reason being on a frequent basis we have to issue material to the contractors who are not staff, therefore, I would like to keep both fields. What I really want is if the material is being issued to a staff, the data entry operator enters staff name in the Combo Box, which will update the "Issued to or received from" text box. If he material is being issued to a contractor, data entry operator will bypass Combo Box and enters the name in the Text box field.

  • eka24 Profile Picture
    20,923 on at

    Can you show the full formula you are using for the Patch?

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • tmawan Profile Picture
    7 on at

    Below is the formula:

    Patch(CovidCOVID_19_Issuance_Receipt,ThisItem,{'Issued to OR Received from_DataCard4_1': ddStaffName1.SelectedText.Value})

     

    Combo Box: ddStaffName1

    Text Box: IssuedReceived1

  • eka24 Profile Picture
    20,923 on at

    Patch(CovidCOVID_19_Issuance_Receipt,ThisItem,{'Issued to OR Received from_DataCard4_1':

    If(IsBlank(ddStaffName1.Selected),IssuedReceived1.Text,ddStaffName1.SelectedText.Value)})

     

    or

    Patch(CovidCOVID_19_Issuance_Receipt,ThisItem,{'Issued to OR Received from_DataCard4_1':

    If(IsBlank(ddStaffName1.Selected),IssuedReceived1.Text,ddStaffName1.Selected.Value)})

     

    Are you Patching from a Gallery?

     

    Meaning if user does not enter in the Combobox, it will patch the Texbox: IssuedReceived1.Text

     

    If you still have issues, kindly show the Items on the Combobox.

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • tmawan Profile Picture
    7 on at

    Thanks again. There's no Gallery in this app, see below snapshot of the SP list:

    SP.JPG

     

    I entered the formula in the OnChange property of Combo Box, however, received below error message:

    error.JPG

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 536

#2
WarrenBelz Profile Picture

WarrenBelz 426 Most Valuable Professional

#3
Haque Profile Picture

Haque 305

Last 30 days Overall leaderboard