cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
simms7400
Level 8

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

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

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

simms7400
Level 8

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!

simms7400
Level 8

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

simms7400
Level 8

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
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (4,266)