Hello,
I am currently developing a PowerApp that allows me to edit and save information on the app to a SharePoint List. As it is currently set up, the first screen is a screen in which you can search up a given person, and a variable is passed through to the second screen that holds the person's ID/Username, this then filters down a hidden gallery to the rows only related to that given person. The second screen is currently a editable gallery that will save changes made, but I currently have to go item by item to edit it. Is there a way for me to be able to apply a specifics row's worth of information downwards? For instance, if I'm on row 8/24 and I change the person's information across all the columns in that row, is there was a way for me to create a button that changes all the rows under that one to the information I just changed it to. Or alternatively only for one column, copying the information down?
Solved! Go to Solution.
You are also missing closing brackets off this - with the button in the gallery, you may be able to do this. It is at times problematic running code from inside a gallery referring to the gallery.
With(
{wRow: ThisItem.RowNo},
Patch(
'TEST - FY23',
ForAll(
Filter(
HiddenForeGall.AllItems,
RowNo >= wRow,
) As aPatch,
{
ID: aPatch.ID,
'C Percentage': aPatch.CBox.Text,
'S Status': aPatch.SStatusBox.Selected,
'T Status': aPatch.TBox.Selected.Value,
Department: aPatch.DepartBox.Selected.Value
}
)
)
)
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
Hi @CatLampMan42069 ,
If you have your gallery rows sequentially numbered (you can do it with this code from my blog on gallery alternate shading), then you would do this
Patch(
YourListName,
ForAll(
Filter(
GalleryName.AllItems,
RowNo >= ThsiItem.RowNo
)
) As aPatch,
{
ID: aPatch.ID,
Field1: aPatch.GalleryField1Control,
Field2: aPatch.GalleryField2Control
. . . . . .
}
)
Note that I have assumed the button is in the gallery on the item and the gallery Items are based on the source list here.
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 for replying! I have tried to implement the code found on your site as the following
With(
{
wList:
Filter(
SPList,
Title = selectedID
)
},
ForAll(
Sequence(CountRows(wList)),
Patch(
Last(
FirstN(
wList,
Value
)
),
{RowNo: Value}
)
)
)
However, when I added this onto the items of the gallery the patch functions within it show up as an error.
I currently set the items of the gallery to have code similiar to this for OnChange.
Patch(SPList, ThisItem, {ColumnName:Value(TextInputBox.Text)})
Do you know what might be the cause for this issue?
Hi @CatLampMan42069 ,
That is because the added column does not exist in the List and ThisItem will not match the record. You should be able to do this
Patch(
SPList,
{ID: ThisItem.ID},
{ColumnName:Value(TextInputBox.Text)}
)
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
Hi @CatLampMan42069 ,
Just checking if you got the result you were looking for on this thread. Happy to help further if not.
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
Hi @WarrenBelz, thank you for the onchange solution it worked! In terms of your initial solution, I was wondering why there are a few errors that show up when I tried to put it onSelect for the button on the gallery; for the "ForAll()Filter()" portion of the solution, the PowerApps says there is "Inavlid number of arguments: received 1, expected 2" and it says the "As" function is not permitted in the context since it is a non-record value. I also had a question for the Field1 portion. Is it supposed to be the name of our column? and for the aPatch.GalleryField1Control, is it supposed to be written like that or am I supposed to substitue my column and gallery name in? Thank you so much for the help you've given!
I would need to see the code and where you were using it to comment - the syntax structure I provided is valid.
Hi @WarrenBelz, thank you for replying again, I greatly appreciate it. I currently have this, and I am given invalid argument errors.
Patch(
SP List,
ForAll(
Filter(
GalleryName.AllItems,
RowNo >= ThisItem.RowNo)
) As aPatch,
{
ID:aPatch.ID,
Column1Name: aPatch.GalleryField1Control,
Column2Name: aPatch.GalleryField2Control,
Column3Name : aPatch.GalleryField3Control,
Column4Name: aPatch.GalleryField4Control
}
)
I assume you have replaced the Gallery, SharePoint List, Column and Control names with your values. Can you please post the actual code you are getting the error on.
Patch(
'TEST - FY23',
ForAll(
Filter(
HiddenForeGall.AllItems,
RowNo >= ThisItem.RowNo)
) As aPatch,
{
ID:aPatch.ID,
'Percentage': aPatch.GalleryField1Control,
'Status': aPatch.GalleryField2Control,
'T Status': aPatch.GalleryField3Control,
Department: aPatch.GalleryField4Control
}
)
User | Count |
---|---|
262 | |
110 | |
98 | |
54 | |
39 |