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 record variable ...
Power Apps
Unanswered

patch record variable field from gallery as new item in SharePoint list

(0) ShareShare
ReportReport
Posted on by

I have a SharePoint list that I use as a audit table. It captures all creations, updates, deletions, etc. It is not dependent on any IDs or lookups. When an action occurs it just captures title, date, person, action.

 

In my PowerApp I have a gallery that lists all of the tasks assigned to the person using the app. There are two buttons in the gallery a detail and delete. The detail button opens up a form on the same screen with the details of the task and a editable status drop down and save button. The other fields are read only including task title. I want to pull the task title from the form into my patch so it automatically displays the task title, so we know what task was deleted.

 

The details button in the gallery is : Set(varTaskRecord,ThisItem)

 

The trash button in the gallery is: RemoveIf(PMSolution,ID=varTaskRecord.ID And varTaskRecord.'Task Assigned'.DisplayName = User().FullName);Patch(PM_Audit, Defaults(PM_Audit),{'Type of Action':{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
Id:6,
Value:"Task Deleted"},Title:"Need to make dynamic to display task title from varTaskRecord",Comments:"Decision by and Requested by is the person who deleted the task.",'Decision ':"Task Deleted",
'Decision By':{
Claims: Concatenate(
"i:0#.f|membership|",
User().Email
),
Department: "",
DisplayName: User().FullName,
Email: varUserEmail,
JobTitle: "",
Picture: ""},
'Decision Date':Today(),'Date Created':Today(),
'Requested By':{
Claims: Concatenate(
"i:0#.f|membership|",
User().Email
),
Department: "",
DisplayName: User().FullName,
Email: varUserEmail,
JobTitle: "",
Picture: ""}})

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,034 Most Valuable Professional on at

    Hi @mjackson122 ,

    Apart from missing a closing bracket, what else in there is not working?

    Patch(
     PM_Audit, 
     Defaults(PM_Audit),
     {
     'Type of Action':
     {
     '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
     Id:6,
     Value:"Task Deleted"
     },
     Title: "Need to make dynamic to display task title from varTaskRecord",
     Comments:"Decision by and Requested by is the person who deleted the task.",
     'Decision ':"Task Deleted",
     'Decision By':
    		 {
     Claims: 
     Concatenate(
     "i:0#.f|membership|",
     User().Email
     ),
     Department: "",
     DisplayName: User().FullName,
     Email: varUserEmail,
     JobTitle: "",
     Picture: ""
     },
     'Decision Date':Today(),'Date Created':Today(),
     'Requested By':
     {
     Claims: 
     Concatenate(
     "i:0#.f|membership|",
     User().Email
     ),
     Department: "",
     DisplayName: User().FullName,
     Email: varUserEmail,
     JobTitle: "",
     Picture: ""
     }
     }
     )
    )

    You also no longer need the "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference" and what type of field is 'Type of Action'?

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

  • mjackson122 Profile Picture
    on at

    Type of action is a choice field. The only field I cannot get to pre-populate is Title. It should pull in the Task Title from the form which items = varTaskRecord

     

    Title:"Need to make dynamic to display task title from varTaskRecord" 

  • WarrenBelz Profile Picture
    153,034 Most Valuable Professional on at

    Hi @mjackson122 ,

    You are pasting text in there at the moment - do you need this?

    Patch(
     PM_Audit, 
     Defaults(PM_Audit),
     {
     'Type of Action':{Value:"Task Deleted"},
     Title: varTaskRecord.Title
     Comments:"Decision by and Requested by is the person who deleted the task.",
     'Decision ':"Task Deleted",
     'Decision By':
    		 {
     Claims: 
     Concatenate(
     "i:0#.f|membership|",
     User().Email
     ),
     Department: "",
     DisplayName: User().FullName,
     Email: varUserEmail,
     JobTitle: "",
     Picture: ""
     },
     'Decision Date':Today(),'Date Created':Today(),
     'Requested By':
     {
     Claims: 
     Concatenate(
     "i:0#.f|membership|",
     User().Email
     ),
     Department: "",
     DisplayName: User().FullName,
     Email: varUserEmail,
     JobTitle: "",
     Picture: ""
     }
     }
     )
    )

    I assume by Choice you do not mean Lookup.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • mjackson122 Profile Picture
    on at

    Yes I do need that info as it patches the other fields. The only field I cannot get to patch correctly is the title field. The type of action is not a lookup field it is a choice field in a SharePoint list.

  • WarrenBelz Profile Picture
    153,034 Most Valuable Professional on at

    @mjackson122 ,

    Title will be a text field, so requires no special code - what exactly are you wanting to patch in it and what (if anything) is patching currently?

  • mjackson122 Profile Picture
    on at

    The only field I cannot get to patch correctly is the title field. The title field needs to look at varTaskRecord.Task but it does not like the scope when I use that. Task is a field in the form which is read-only.

  • WarrenBelz Profile Picture
    153,034 Most Valuable Professional on at

    @mjackson122 ,

    Go to View > Variables and have a look what is in varTaskRecord.Task 

  • Community Power Platform Member Profile Picture
    on at

    Just realized its varTaskRecord.Title that I need. Under variables varTaskRecord shows:

     

    Definitions: home.galtaskhome.ic_tskdetails.OnSelect   Set(varTaskRecord.ThisItem);Navigate(TaskUpdate)

     

    Uses: TaskUpdate.frmtasks_home.Item      varTaskRecord

    Home.galtaskhome.tsktrash.OnSelect then it shows all the code I have listed above beginning with Remove

     

    Indirect uses: None listed

  • Verified answer
    mjackson122 Profile Picture
    on at

    I figured it out. I need to use thisitem.Title

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard