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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patch to SharePoint Li...
Power Apps
Answered

Patch to SharePoint List from choice selection which references a list

(0) ShareShare
ReportReport
Posted on by

Hello all,

 

Please help me with this issue. 

 

I have the patch below which compiles.

 

Patch(RCAData, Defaults(RCAData),
 { 
 BatchID:DataCardValue16_1.Text,
	 WaferID:DataCardValue28_1.Text,
 TrackInTime:Now(),
	 RCARecipe:DataCardValue14.Selected,
	 RCAEquipment:DataCardValue27.Selected,
	 TrackInComments:DataCardValue4.Text,
 Assignment:DataCardValue3.Selected.Value,
 TrackInOperator: OperatorDropDown_1.Selected.Operator
 }
 );
Patch(BatchTrack, LookUp(BatchTrack, 'Batch ID'=DataCardValue16_1.Text && 'Wafer ID'=DataCardValue28_1.Text),
 {
 State: {Value: "TrackOut"},
 OpCode: 11 
 }
);
ResetForm(Form1);
Navigate(BrowseScreen1)

 

It works but I have one issue, some of the data doesn't arrive at the SharePoint list destination. An example of the code for this data fault is: 

 

TrackInOperator: OperatorDropDown_1.Selected.Operator

 

This is a drop down which references a SharePoint list for the choices, the list for the choices is named 'Operator' and the dropdown box is named 'OperatorDropDown_1'. The target in the SharePoint list named 'RCAData' is 'TrackInOperator'. It's important I can access the operator list in many different app screens and patch the selected data to different SharePoint lists.

 

Can someone tell me if my code makes sense and how to get it to work. 

Thanks all.

 

Categories:
I have the same question (0)
  • Anchov Profile Picture
    1,986 on at

    In you SharePoint list, RCAData, what is the data type of the TrackInOperator column? Is this a choice column, lookup column or a Single line of text field?

  • rob4681 Profile Picture
    on at

    Hi Anchov,

    A single line of text. It wouldn't compile otherwise.

    Thanks 

  • Anchov Profile Picture
    1,986 on at

    Ok, what is the Items property for your OperatorDropDown_1 drop down?

     

  • rob4681 Profile Picture
    on at

    Operator then column operator in value which points to the list 

  • Verified answer
    Anchov Profile Picture
    1,986 on at

    It would be beneficial if you could share your formula. Regarding the dropdown control, I generally find success by setting the "Items" property to a single-column table or list. For instance:

    SharePointListName.Operator

    Then with your patch statement update to:

    Patch(RCAData, Defaults(RCAData),
     { 
     BatchID:DataCardValue16_1.Text,
    	 WaferID:DataCardValue28_1.Text,
     TrackInTime:Now(),
    	 RCARecipe:DataCardValue14.Selected,
    	 RCAEquipment:DataCardValue27.Selected,
    	 TrackInComments:DataCardValue4.Text,
     Assignment:DataCardValue3.Selected.Value,
     TrackInOperator: OperatorDropDown_1.Selected
     }
     );


    If you need to access multiple columns from a dropdown choice, you might find better success using a ComboBox control.

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    on at

    HI @rob4681,

    Do you mean that you populate the OperatorDropDown_1 with operator list which is a totally different list from RCAData that you want to patch data to?

     

    I have something confused, that I hope you could help me to figure it out, which is that you set the OperatorDropDown_1 with Operator.operator ,right?

    And, surely operator is a text column in Operator list, right?

    Operator then column operator in value which points to the list 

     

    If the above is correct, I think you formula is correct, the data should be saved successfully to TrackInOperator    in  RCAData, unless TrackInOperator is a LookUp type column.

     

  • rob4681 Profile Picture
    on at

    I will accept this as solution as I found it useful to check my code. Turns out my code was ok. I deleted the button and created a new one after resetting PowerApps then pasted the code in. It worked! Thanks for your help.

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 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard