cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Super User
Super User

Patching problem

Hey all

 

 

I want to know if it is possible to Patch a Textbox.Text into a SharePoint lookup column? 

And how is it done?

If this would be possible all my problems would be solved!!!

 

Thanks in advance

 

Kind regards

 

 

Tom





Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!





2 ACCEPTED SOLUTIONS

Accepted Solutions
Meneghino
Level 10

Re: Patching problem

Hi @Tom_Slosse

It seems as though you actually only have one SharePoint column in the 'My Lunch' list, and the column is simply Code.  Don't be confused by the extra columns that SharePoint creates when you choose to display extra columns.

So you need to patch simply to that column:

Patch('My Lunch', MyItem, {Code: {Id: Dropdown1.Selected.ID, Value: Dropdown1.Selected.Title, '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"}})

Obviously you need to specify the item where I have simply written MyItem, and if you want to create a new item then use Defaults('My Lunch') instead.

 

Try to just put hard values for Id and Value and see if it works, then you can link back to your control.

View solution in original post

Meneghino
Level 10

Re: Patching problem

Hi @Tom_Slosse

I would suggest you try creating a new test list and a new blank app and see if this works for you doing the steps exactly as indicated:

https://powerusers.microsoft.com/t5/PowerApps-Forum/Solved-patching-to-SharePoint-choice-and-lookup-...

If it does not, then I will try to reproduce myself again.  If it does, then you will have a much clearer idea of what needs to be done.

View solution in original post

21 REPLIES 21
Meneghino
Level 10

Re: Patching problem

Highlighted
Super User
Super User

Re: Patching problem

Hey @Meneghino

 

 

I read this post before and was really interessting but I think my problem is somewhat different

 

Let me try and explain what my situation is 🙂

So i have a Gallery from the Source 'Broodjes' looking like this:

broodjesgallery.PNG

When I click on the icon we move to the next screen looking like this:

nieuwbroodje.PNG

where the textboxes are filled in with the selected item from the BroodjesGallery:

text_nieuwbroodje.PNG

But now comes the tricky part, when I click save I want to patch it all into another list, that is called 'My Lunch', by using the Patch function.

Looks easy on first sight I thought but here is the thing, in 'My Lunch' list all the columns are lookup fields like so:

sharepoint_nieuwbroodje.PNG

All the fields are actually derived from Code in the 'Broodjes' list:

code_sharepoint.PNG

I hope I was clear enough with my problem if not please let me know, I would be grateful if this would work

 

Thanks in advance

 

Kind regards

 

 

Tom





Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!





Meneghino
Level 10

Re: Patching problem

Hi @Tom_Slosse

It seems as though you actually only have one SharePoint column in the 'My Lunch' list, and the column is simply Code.  Don't be confused by the extra columns that SharePoint creates when you choose to display extra columns.

So you need to patch simply to that column:

Patch('My Lunch', MyItem, {Code: {Id: Dropdown1.Selected.ID, Value: Dropdown1.Selected.Title, '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"}})

Obviously you need to specify the item where I have simply written MyItem, and if you want to create a new item then use Defaults('My Lunch') instead.

 

Try to just put hard values for Id and Value and see if it works, then you can link back to your control.

View solution in original post

Super User
Super User

Re: Patching problem

Hey @Meneghino

 

 

Thanks for your quick response, I will try it immediately!

And what do you mean by hard values?

 

Kind regards

 

 

Tom





Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!





Meneghino
Level 10

Re: Patching problem

I mean something like:

 

Patch('My Lunch', Defaults('My Lunch'), {Code: {Id: 1, Value: "Title of ID 1", '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"}})
Super User
Super User

Re: Patching problem

Hey @Meneghino

 

 

The Patch works but still only saves the date and the matching text values and the toggle, but the rest (the important information) still doesnt save.

 

Patch_broodje.PNG

 

But the ordered item comes in the BrowseScreen so we are a step closer to the solution!

So thanks for that already 🙂

after_Patch_broodje.PNG

Here are some screenshots below of what it looks like in the SharePoint list now:

after_Patch_broodje_SP.PNG

 

Thanks for your help already really appreciate your efforts!!!

 

Kind regards

 

 

Tom

 





Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!





Meneghino
Level 10

Re: Patching problem

You need to make sure Id and the Value are really matched.  Is your Id 1 really "Kaas, hawaii etc."?

Or is it Code?

Did you rename the Title column?  If so to what?

Otherwise it will not save.

Super User
Super User

Re: Patching problem

Hey @Meneghino

 

 

My Id is Code indeed. "Kaas,hawaii" is actually the description that is linked with the Code.

So thats why I have columns like this: Code_x003a_Description Code_x003a_Price, Code_x003a_Size, Code_x003a_Supplier

I didnt change Title in both lists, I only set them to hidden in the lists:

broodjes_SP.PNGmijnlunch_SP.PNG

 

Kind regards

 

 

Tom





Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!





Meneghino
Level 10

Re: Patching problem

OK, clear.  Value in the Patch expression should contain the Title.

If you have nothing there, then try "", but I am not sure it will work.

If not, then experiment with another list and putting the Title to "AAA" or something.

If that works, then just put AAA in all Titles of your code table.

Please let me know how you get on.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,837)