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

Changing a column value of a SharePoint element listed in a gallery from a PowerApps

So I'm currently trying to build a Inventory App and I was playing with the data of a column that indicates if a PC is avaible or not.

Currently I show that status with an icon changing color depending of the choice.

 

I want to change the actual value of that status column from the item from avaible ("Libre") to unavaible ("Ocupado") whenever I click on the Icon itself. I manage to do it but i wonder if there's an easy way to do it. The Choice column name is Disponibilidad.

I used Updateif but I cant understad how the ID inside it works, I set it on 1 and it works but I truly don't know how.

I'm thinking of using a lot of buttons that will change column values so I want to learn the right way to do it. 

 

Here's the code currently working:

 

UpdateIf(
    'Proyecto Facu';
    ID = Gallery1.Selected.ID && Gallery1.Selected.Disponibilidad.Value = "Ocupado";
    {
        Disponibilidad: {
            '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference";
            ID: 1;
            Value: "Libre"
        }
    };
   ID = Gallery1.Selected.ID && Gallery1.Selected.Disponibilidad.Value = "Libre";
    {
        Disponibilidad: {
            '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference";
            ID: 1;
            Value: "Ocupado"
        }
    }
)
1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Changing a column value of a SharePoint element listed in a gallery from a PowerApps

If it is a choice column then you shouldn't need the 'ID: 1". If it is a lookup column then you would need it and the value would be ID of the item in the lookup list.



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

4 REPLIES 4
Super User
Super User

Re: Changing a column value of a SharePoint element listed in a gallery from a PowerApps

If it is a choice column then you shouldn't need the 'ID: 1". If it is a lookup column then you would need it and the value would be ID of the item in the lookup list.



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

FacundoGorla
Level 8

Re: Changing a column value of a SharePoint element listed in a gallery from a PowerApps

Oh, great. So I can remove that part and it will continue to work, besides that is this well done?

Community Support Team
Community Support Team

Re: Changing a column value of a SharePoint element listed in a gallery from a PowerApps

Hi @FacundoGorla ,

 

Is there any error or red lines under this formula in PowerApps? If not, then the formula should work as expected.

 

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.
FacundoGorla
Level 8

Re: Changing a column value of a SharePoint element listed in a gallery from a PowerApps

It worked just fine! thanks! already marked the answer!

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

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