I'm creating an "Enquiries App" for customers to submit a request for research to be done by our Library department.
There are 2 main Sharepoint lists called "Reference Desk Enquiry" and "Reference Desk Enquiry Admin".
The "Reference Desk Enquiry" app allows anyone to submit a request, and the Admin list is for the Library researchers to use for the work to be done.
The first list needs to store the List item ID value of the Enquiry record in to a column called 'Reference ID', so that it can be referenced by the Admin Sharepoint list as a unique ID.
This is because all list data from the "Reference Desk Enquiry submitted" gets copied by a "Flow" into the Admin Sharepoint list.
All that being said, I’m trying to use the Patch function to write the value (list item ID) from a Global Variable into the field called 'Reference ID, in the Reference Desk Enquiry list.
This is my patch function so far.....
Patch('Reference Desk Enquiries',First(Filter('Reference Desk Enquiries',Reference_x0020_ID=varEnquiryID)))
The Reference ID columns is not the first one in the list, so I think that could be the issue.
See Attachment OnSuccess Function.jpg
The PowerApp creates the SP list record with my "Save" button below, using the OnSelect function of the Form.
It submits the form, notifies the user of success.
It also has a global variable called varEnquiryID that stores the ID of the list item, from the form using "LastSubmit.ID".
The variable does contain the correct ID number, so there is no issue with this..
Obviously the record needs to be submitted first so that the ID number can be recorded after the PowerApp OnSelect function has ran.
I have tried my patch function in the OnSelect function of the "Save" button on the main screen of the form, which is after the record has been written,
and also in the OnSuccess Function of the actual form, with no success, so far.
See Attachment OnSelect Function.jpg
For your information:-
The SP List is called 'Reference Desk Enquiries'
The SP List column is called 'Reference_x0020_ID'
The global variable is called varEnquiryID
The form is called frmCreate_Ref_Desk_Enquiry
I believe that I'm on the right track, and think it might have something to do with being able to refer to the correct record to update in the SP List, or the actual column itself.
I would appreciate any help that you can provide,
What is your current situation?
For new record creation, the patch () function should be written as:
Patch('Reference Desk Enquiries', Default('Reference Desk Enquiries'), First(Filter('Reference Desk Enquiries',Reference_x0020_ID=varEnquiryID)))
For how to use the patch(), see:
Thanks for your response.
The record has just been created by my powerapp, so I want to update a column with the ID of the new item created.
So its an update or modify an existing record.
I can capture the ID of the record just created by using the "lastsubmit;ID.
Just need to write that ID value into the column "Reference_x0020_ID "
Stewart - newbie at Powerapps
Hello @HollyHugo ,
As you solved them, I have a similar problem. I need to update the search ID of the child list in order to add records by referencing the parent ID.
I am trying it with the Path function, if it updates text and numeric fields, but the field ID (search ID in my child list) gives me the following message:
"the type of this argument 'Id_header' Does not match expected 'Record' type argument"
thank you for your comments.
Your chance to join an engaging competition of Power Platform enthusiasts.
The Super User program for 2022 - Season 2 has kicked off!
Attend in person or online, there are incredible conferences and events happening all throughout the month of September.
In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.