cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Post Prodigy
Post Prodigy

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

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!

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

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

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Community Support
Community Support

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

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

@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!

@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

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

 

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

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (7,200)