cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ericongkc
Frequent Visitor

update sharepoint value with button and show updated value immediately on Gallery Screen

Hi all

Can i make a button on my gallery screen so that when i click it, it will update my sharepoint Choice"Status" value to "inStock" and reflect immediatelly on the gallery "Thisitem.Status.Value" fomula?

 

What fomula should i put on this button - onselect

Screenshot 2019-10-22 at 7.48.26 AM.png

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

Hi @ericongkc ,

Do you want to:

if the button's text is inStock, click the button, the choice value change to inuse,

if the button's text is inuse, click the button, the choice value change to inStock?

You could try to set the button's OnSelect:

If(ThisItem.Status.Value="InStock",
Patch(listname,ThisItem,{Status:{Value:"InStock"}}),
ThisItem.Status.Value="InUse",
Patch(listname,ThisItem,{Status:{Value:"InUse"}}));
Refresh(listname) //please replace listname with your listname

 

 

Best regards,

Community Support Team _ Phoebe Liu
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

2 REPLIES 2
Edwin-Abdalian
Solution Supplier
Solution Supplier

use the patch function on select of your Gallery.

Patch(
    'Your SharePoint List',
    ThisItem,
    {
        myChoice: {
            Value: "inStock",
            '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"
        }
    }
)

 --------------------------------------------------------------------

Please Accept as Solution if this post answered your question so other members can find it. If you found this post helpful consider giving my post a Thumbs Up!

v-yutliu-msft
Community Support
Community Support

Hi @ericongkc ,

Do you want to:

if the button's text is inStock, click the button, the choice value change to inuse,

if the button's text is inuse, click the button, the choice value change to inStock?

You could try to set the button's OnSelect:

If(ThisItem.Status.Value="InStock",
Patch(listname,ThisItem,{Status:{Value:"InStock"}}),
ThisItem.Status.Value="InUse",
Patch(listname,ThisItem,{Status:{Value:"InUse"}}));
Refresh(listname) //please replace listname with your listname

 

 

Best regards,

Community Support Team _ Phoebe Liu
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

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Did you miss the call? Check out the recording here!

Top Solution Authors
Top Kudoed Authors
Users online (16,877)