cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Patch a global variable to SharePoint list.

Hi everyone!

I have a question, Can I patch a global variable to a Text field in a sharepoint list? 

 

Thanks in advance

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Patch a global variable to SharePoint list.

Hi RuhmaJubran,

 

Some questions:

a) Is this an existing record in SharePoint you want to update? If it is an existing record, you would have to pass the record in the patch command as well. If it is a new record, you need to tell patch to create a new record.

b) Is the info in the lineManager variable just a single value, or is it an object that contains various information from a dropdown or gallery?

 

Create new record with a variable that only contains a name or email address:

Patch('Induction Process',{ID:Blank()},{Manager:LineManager})

The above is faster at runtime, but you can also use the following to create a new record:

Patch('Induction Process',Defaults('Induction Process'),{Manager:LineManager})

Update existing record with a variable that only contains a name or email address:

Patch('Induction Process',{ID:recordID},{Manager:LineManager})

I think the above is faster at runtime, but you can also use the following to update an existing record:

Patch('Induction Process',Filter('Induction Process',ID=RecordID) ,{Manager:LineManager})

Update existing record with a variable that only contains an object with information:

Patch('Induction Process',Filter('Induction Process',ID=RecordID) ,{Manager:LineManager.Email})

 

Let me know if you don't come right.

 

View solution in original post

7 REPLIES 7
Sienna
Level 10

Re: Patch a global variable to SharePoint list.

I'm sure you can

Super User
Super User

Re: Patch a global variable to SharePoint list.

Hi @Anonymous,

 

Yes, we are using it in one of our apps.

P.

Super User
Super User

Re: Patch a global variable to SharePoint list.

Hi RuhmaJubran.

 

Yes you can, but just keep in mind that a global variable might be text or a record. Are you getting an error? If so, please send this to us.

 

Have a great day.

Anonymous
Not applicable

Re: Patch a global variable to SharePoint list.

HI again 🙂 

 

yes I'm receiving an error.

The name of my list is 'Induction Process', the name of the field iin the list I want to patch is 'Manager'.  and the vairable is LineManager. 

how can I make it work ? 

I tried Patch('Induction Process',  Manager, LineManager). 

should I be using First and Filter ? 

 

I'm still a newbie in Powerapps 

 

Thanks in advance!! 

Super User
Super User

Re: Patch a global variable to SharePoint list.

Hi RuhmaJubran,

 

Some questions:

a) Is this an existing record in SharePoint you want to update? If it is an existing record, you would have to pass the record in the patch command as well. If it is a new record, you need to tell patch to create a new record.

b) Is the info in the lineManager variable just a single value, or is it an object that contains various information from a dropdown or gallery?

 

Create new record with a variable that only contains a name or email address:

Patch('Induction Process',{ID:Blank()},{Manager:LineManager})

The above is faster at runtime, but you can also use the following to create a new record:

Patch('Induction Process',Defaults('Induction Process'),{Manager:LineManager})

Update existing record with a variable that only contains a name or email address:

Patch('Induction Process',{ID:recordID},{Manager:LineManager})

I think the above is faster at runtime, but you can also use the following to update an existing record:

Patch('Induction Process',Filter('Induction Process',ID=RecordID) ,{Manager:LineManager})

Update existing record with a variable that only contains an object with information:

Patch('Induction Process',Filter('Induction Process',ID=RecordID) ,{Manager:LineManager.Email})

 

Let me know if you don't come right.

 

View solution in original post

Anonymous
Not applicable

Re: Patch a global variable to SharePoint list.

That worked!! Thank's every one 😄

CindyZ
Level: Powered On

Re: Patch a global variable to SharePoint list.

I have two SharePoint lists -one to many.  List1 is the core record -- the 1 side of things.   List 2 is the many side. 

From within a form, I'm changing a couple of fields in List 2 that I'd like to also update to List 1.   In addition to submitting a number of field values to List 2 when I submit my form, I'd like to Patch a couple of the fields back to List 1.  I'm capturing those fields in a variable. 

 

1 field is a choice, 1 field is a simple number, 1 field is a person field.   I've only taken on the choice field in this example. 

 

I've tried lots and lots of interations and I'm not getting anywhere on this one.  It seems -- from my limited view -- my issue is with the ID field from my gallery since I keep getting a message "Invalid argument type; expecting a record value instead".  Of course, there may be other issues but that seems to be the one I'm hitting over and over again.  

Interestingly, it almost always returns my correct value since I'm checking the formula but there is something wrong with my nomenclature that it will not let me continue or arrive at a working formula. 

 

I was trying to follow the instructions but at no point could i get it take a bracket.  Maybe if I understood what the bracket means here, it would help.  

 

Any insight on this one?    Not sure if the illustration will help but in both cases, the sharepoint list/table refers to List 1.  I just finally gave up so it is not complete. 

 

Thank you.  

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (3,005)