Hello,
I had this code on another screen, but when I am trying to apply it to the new one (which has the same components but the Gallery name Excel) is showing me this:
And the second would be, I am having multiple data in the Gallery Excel:
How can use the code above to save the data in the SharePoint list without affecting the other record (like a SQL Update using the where clause)?
Thanks in advance for the help.
Solved! Go to Solution.
Hi @Emont ,
I have no idea why your Excel Table is empty, but your ForAll Patch needs to takes this form
ForAll(
CollCatDescServUpd,
Patch(
CATEGORIASERVICIOSDATAGATHERING As aPatch,
LookUp(
CATEGORIASERVICIOSDATAGATHERING,
FOLIO = aPatch.FOLIO &&
SERVICEDESCRIPTION = aPatch.SERVICEDESCRIPTION &&
TYPEOFSERVICE = aPatch.TYPEOFSERVICE
),
{
TYPEOFSERVICE: aPatch.TYPEOFSERVICE,
SERVICEDESCRIPTION: aPatch.SERVICEDESCRIPTION,
QUANTITYTYPEOFSERVICE: aPatch.QUANTITYTYPEOFSERVICE,
UNITOFMEASURESERVICEDESCRIPTION: aPatch.UNITOFMEASURESERVICEDESCRIPTION,
CAPACITYSERVICEDESCRIPTION: aPatch.CAPACITYSERVICEDESCRIPTION,
HSECOMMENTS: aPatch.HSECOMMENTS
}
)
);
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps
@Emont ,
What is the error that is showing here and what are the Items of the Excel Gallery?
@Emont ,
Is Excel the actual name of the Gallery and do the four fields exist in collCatDescServ2 (I assume this is a collection). How do you collect this as the error refers to the Author field, which is actually Created by in the list.
I was able to change the code but now is not working with the filter:
ForAll(
CollCatDescServ,
Patch(
CATEGORIASERVICIOSDATAGATHERING,
First(Filter(CATEGORIASERVICIOSDATAGATHERING, Excel.Selected.FOLIO, Excel.Selected.SERVICEDESCRIPTION, Excel.Selected.TYPEOFSERVICE)),
{
//Title: COLLTYPEOFSERVICE,
TYPEOFSERVICE: Excel.Selected.TYPEOFSERVICE,
SERVICEDESCRIPTION: Excel.Selected.SERVICEDESCRIPTION,
QUANTITYTYPEOFSERVICE: Excel.Selected.QUANTITYTYPEOFSERVICE,
UNITOFMEASURESERVICEDESCRIPTION: Excel.Selected.UNITOFMEASURESERVICEDESCRIPTION,
CAPACITYSERVICEDESCRIPTION: Excel.Selected.CAPACITYSERVICEDESCRIPTION,
HSECOMMENTS: Excel.Selected.HSECOMMENTS
//NUMBER: COLLNUMBER,
//UOMSERVICEDESCRIPTION: ,
//FOLIO: "WellLogistic-" & varLastRequest1.ID
}
)
);
Notify("El registro fue actualizado",NotificationType.Success);
/*Patch(
Error:
@Emont ,
You did not really answer the questions I asked
Also that is not a valid Lookup - the parameters have to equal something.
First(
Filter(
CATEGORIASERVICIOSDATAGATHERING,
Excel.Selected.FOLIO,
Excel.Selected.SERVICEDESCRIPTION,
Excel.Selected.TYPEOFSERVICE
)
),
Hello @WarrenBelz I hope you have a great 2022!
Sorry I was not able to connect because I was on vacations.
So here are the answers to the issue reported:
UpdateContext({vGallery1_4:false});
UpdateContext({RequestTOFF4:false});
UpdateContext({vLabel17:false});
UpdateContext({vRectangle5:false});
Collect(
CollCatDescServ2,
{
COLLTYPEOFSERVICE: Excel.Selected.TYPEOFSERVICE,
COLLSERVICEDESCRIPTION: Excel.Selected.SERVICEDESCRIPTION,
COLLQUANTITYTYPEOFSERVICE: Excel.Selected.QUANTITYTYPEOFSERVICE,
COLLUNITOFMEASURESERVICEDESCRIPTION: Excel.Selected.UNITOFMEASURESERVICEDESCRIPTION,
COLLCAPACITYSERVICEDESCRIPTION: Excel.Selected.CAPACITYSERVICEDESCRIPTION,
COLLHSECOMMENTS: Excel.Selected.HSECOMMENTS
//COLLNUMBER: Excel.Selected.Number
}
);
The code is triggered when the Pencil or edit Button is pressed:
Then I pressed the Edit button to make all fields available and after that I press the Save Info Button and this is the code:
ForAll(
CollCatDescServ2,
Patch(
CATEGORIASERVICIOSDATAGATHERING,
First(Filter(CATEGORIASERVICIOSDATAGATHERING, Excel.Selected.FOLIO, Excel.Selected.SERVICEDESCRIPTION, Excel.Selected.TYPEOFSERVICE)),
{
//Title: COLLTYPEOFSERVICE,
TYPEOFSERVICE: Excel.Selected.TYPEOFSERVICE,
SERVICEDESCRIPTION: Excel.Selected.SERVICEDESCRIPTION,
QUANTITYTYPEOFSERVICE: Excel.Selected.QUANTITYTYPEOFSERVICE,
UNITOFMEASURESERVICEDESCRIPTION: Excel.Selected.UNITOFMEASURESERVICEDESCRIPTION,
CAPACITYSERVICEDESCRIPTION: Excel.Selected.CAPACITYSERVICEDESCRIPTION,
HSECOMMENTS: Excel.Selected.HSECOMMENTS
//NUMBER: COLLNUMBER,
//UOMSERVICEDESCRIPTION: ,
//FOLIO: "WellLogistic-" & varLastRequest1.ID
}
)
);
Notify("El registro fue actualizado",NotificationType.Success);
This Authors field cannot find it sorry, where did you see it?
That's Excel Gallery with its items
Thank you so much for your help, I am really thankful.
Hi @Emont ,
Firstly the Author field is the error you posted
Next, your filter criteria is not specifying the record you want to patch (what is the key unique field in CollCatDescServ2 that matches the record in CATEGORIASERVICIOSDATAGATHERING ?
Your Patch would be something like this
ForAll(
CollCatDescServ2,
Patch(
CATEGORIASERVICIOSDATAGATHERING As aPatch,
{IDField:aPatch.IDField},
{
TYPEOFSERVICE: aPatch.TYPEOFSERVICE,
SERVICEDESCRIPTION: aPatch.SERVICEDESCRIPTION,
QUANTITYTYPEOFSERVICE: aPatch.QUANTITYTYPEOFSERVICE,
UNITOFMEASURESERVICEDESCRIPTION: aPatch.UNITOFMEASURESERVICEDESCRIPTION,
CAPACITYSERVICEDESCRIPTION: aPatch.CAPACITYSERVICEDESCRIPTION,
HSECOMMENTS: aPatch.HSECOMMENTS
}
)
);
Notify("El registro fue actualizado",NotificationType.Success);
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps
Thank you @WarrenBelz I was checking and I was able to find the issue and it was related with the Collection name and I change it but now is showing an error:
And the reason I choose these three values is because there are several records with the same folio number, so I try to narrow down to just one record.
How to fix this issue?
Thanks in advance for the assistance.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
205 | |
70 | |
49 | |
48 | |
20 |
User | Count |
---|---|
252 | |
125 | |
84 | |
75 | |
73 |