cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
FacundoGorla
Helper V
Helper V

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
Jeff_Thorpe
Super User
Super User

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
Jeff_Thorpe
Super User
Super User

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.

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

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.

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

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

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