cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JerryH
Resolver III
Resolver III

Patch Function

Hi Team, 

I have coded my Patch function. See Image 1 however the fields are not appearing on my SP list? See Image 2

However, toggle value is showing a 'tick' - was hoping this would be a Yes or No

 

Patch1.PNGPatch2.PNG

 

9 REPLIES 9
AJ_Z
Super User
Super User

Are you trying to edit or add new rows.

 

If it is to add new rows I would have expected the patch to look more like this:

Patch(SWR_Training,
Defaults(SWR_Training),
{Title:Dropdown4.SelectedText.Result,
Surname: Dropdown2.Selected.Result,
BaseSite: Dropdown1.SelectedText.Value,
Region: Dropdown4.Selected.Result,
SWR1:Toggle1.Value,
SWR2:Toggle1_1.Value,
SWR3:Toggle1_2.Value,
SWR4:Toggle1_3.Value,
}
);

Navigate(AttachRecords)

 

if it is to edit a record it would be something like this:

 

Patch(SWR_Training,
/*INSERTRECORDHERE this might typically be a lookup or a selected record reference elsewhere*/,
{Title:Dropdown4.SelectedText.Result,
Surname: Dropdown2.Selected.Result,
BaseSite: Dropdown1.SelectedText.Value,
Region: Dropdown4.Selected.Result,
SWR1:Toggle1.Value,
SWR2:Toggle1_1.Value,
SWR3:Toggle1_2.Value,
SWR4:Toggle1_3.Value,
}
);

Navigate(AttachRecords)

 

Please replace this:

/*INSERTRECORDHERE this might typically be a lookup or a selected record reference elsewhere*/

with the record for editing

 

also SelectedText is deprecated so where you write: Dropdown4.SelectedText.Result

it should be Dropdown4.Selected.Result or Dropdown4.Selected.Value it may even be something else depending on the source so see the options after Dropdown4.Selected. and select accordingly. Usually by default it is Result or Value or the ColumnName it has been changed to.



Signature:


If you appreciated my comments/responses please be sure to Like/Kudo them it really does make me smile 🙂 !
Link to the Power Platform Professionals United Kingdom User Group:

https://powerusers.microsoft.com/t5/Power-Platform-Professionals/gh-p/PowerPlatformProfessionalsUnit...

Thanks for helping.

1. I'm trying to add rows

1. Fields are still not patching.

2. Toggle is patching as a tick, not a 'Yes'

 

Patch3.PNG

RandyHayes
Super User
Super User

@JerryH 

You should consider removing the SelectedText references in your formula.  That property has been deprecated and should be avoided.

 

To first test where the problem comes from, make a manual change to your formula such as:

Patch(SWR_Training,
    {Title: "TitleHere",
     Surname: "SurNameHere",
     BaseSite: "BaseSiteHere",
     Region: "RegionHere",
     SWR1:Toggle1.Value,
     SWR2:Toggle1_1.Value,
     SWR3:Toggle1_2.Value,
     SWR4:Toggle1_3.Value,
    }
)

Perform this action and look at your list to see if the values specified appear.

 

The Yes/No columns are fine.  SharePoint shows check marks in place of Yes in Yes/No columns...this is purely a SharePoint view thing.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Unfortunately still not appearing on my SP List.

 

Patch(SWR_Training,
{Title: Dropdown4.Selected.Result,
Surname: Dropdown2.Selected.Result,
BaseSite: Dropdown1.Selected.BaseSite,
SWR1: Toggle1.Value,
SWR2: Toggle1_1.Value,
SWR3: Toggle1_2.Value,
SWR4: Toggle1_3.Value
}
)

RandyHayes
Super User
Super User

@JerryH 

Did you perform the test?

Patch(SWR_Training,
    {Title: "TitleHere",
     Surname: "SurNameHere",
     BaseSite: "BaseSiteHere",
     Region: "RegionHere",
     SWR1:Toggle1.Value,
     SWR2:Toggle1_1.Value,
     SWR3:Toggle1_2.Value,
     SWR4:Toggle1_3.Value,
    }
)

 

If so, and that did not work, then what are all of the types of your columns?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Hi

Yes i tested it. SP does not display the fields.

Columns in SP are Single line of text

 Capture22.PNG

RandyHayes
Super User
Super User

@JerryH 

So, since that formula should be working, you'll need to look a little deeper at what is going on behind the scenes.

Open the monitor tool and then perform the formula (with the hard-coded value test) and see what the request is and what the server response is.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Hi R, Pls see image. Thank you for your support.

 

Capture33.PNG

HI R, Just for your information, on a different page in App, i have Attachment Control which contains word Title. Not sure if this would impact on my challenge?

Capture44.PNG

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Solution Authors
Top Kudoed Authors
Users online (2,983)