cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Community Support
Community Support

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

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
Highlighted
Community Support
Community Support

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

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

Highlighted
Post Prodigy
Post Prodigy

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

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

Highlighted
Post Prodigy
Post Prodigy

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

@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

Highlighted
Post Prodigy
Post Prodigy

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

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

 

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

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,388)