web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Modify a SP field from...
Power Apps
Answered

Modify a SP field from selecting a button in a gallery?

(0) ShareShare
ReportReport
Posted on by 829

Hi Folks -

 

I have an EditForm that end users use to associate data elements to one another (i.e. Parent/Child relationship) for a certain hierarhcy we build to show certain associations for reporting purposes.

 

However, I also want to give them the ability to remove an associate if needed as well.  Therefore, I put a "Trash" icon in my gallery.  My hope is that when they click that button, the field "RequestStatus" in SP will update with "Remove".   Then from there, I have MS Access functions use to actually perform the operation in the Oracle based application.

 

How can I achieve this?  I'd like to use the "SubTitle2" field (which is "Associated_Element") in my gallery as the identifer in my table to make the change.

 

Here is a picture of my form:

PA.png

 

Now here is my table:

row.png

 

So, if I were to click on the "Trash can" for the PFR-3608-100 element, "Remove" would be then be placed in the "RequestStatus" field in the applicable row in the data source.

 

How would I acheive this? I have the logic to send a value to a field but this is when I can place this logic in the actual field on my form in the "Default" section (I use the below for my "RequestStatus" field across all my forms)...

 

If(PartnerAssetEditForm.Mode = New,{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
 Value:"New"},{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
 Value:"Updated"})

I'm not sure how to use a button to do the same thing though.   Thank you!

Categories:
  • Verified answer
    v-monli-msft Profile Picture
    Microsoft Employee on at

    Hi @simms7400 ,

     

    Did you mean that you want to update the RequestStatus column when selecting the trash icon? If so, you could use below formula in the OnSelect property of the icon:

    Patch(ListName,{ID:ThisItem.ID}, {Title: Label1.Text, RequestStatus:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
    Id:3,
    Value:"Remove"}}))

    In this formula, Remove is the third choice value in RequestStatus choice column in SharePoint.

     

    If my understanding is incorrect, please tell.

     

    Regards,

    Mona

  • simms7400 Profile Picture
    829 on at

    @v-monli-msft  Thank you!

     

    One clarifying question, what the following represent?

    Title: Label1.Text

     Label1 in my form (see screen) is just a text label and really has no signifiance.  Also, I changed "ThisItem.ID" to "ThisItem.Associated_Element" as that how it is on my SP list - that ok?

    Thanks!

  • simms7400 Profile Picture
    829 on at

    @v-monli-msft  A quick follow up - I got it to work, but it's creating a net new entry on my SP last rather than update the correct record.

     

    here is my syntax - am I doing anything wrong? Thanks!

     

    Patch(rdPartnerAssets,{Associated_Element:ThisItem.Associated_Element}, {Title: Subtitle2.Text, RequestStatus:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
    Id:6,
    Value:"Remove"}})

    And here is a picture of my table:

    save.png

  • simms7400 Profile Picture
    829 on at

    @v-monli-msft  false alarm, this is working as expected.

     

    Sorry for the hassle and thank you so much!!!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 350 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 318

#3
Mohsin Ali Profile Picture

Mohsin Ali 220

Last 30 days Overall leaderboard