Hello community!
So, I have an inventory app to track cabling. When the user selects the update button, a SharePoint list item is updated. Now, I want to add each item that was updated to an Excel spreadsheet. I want to include the Title, Color, Length, and amount the inventory was changed. Code and screenshots below:
**Excel table - PulledInventory
**Screen 1; all inventory items; items that are checked appear in pop up window gallery; depending on what button the user hits at the bottom, the inventory quantity will be incremented or decremented
**All checked items appear in this gallery with a text box; the user puts in the amount of cables they are either taking or adding (depending on what button they hit on Screen 1); upon hitting Update, it adjusts the inventory total of that item on the SharePoint list
**Update button code (middle section that starts with ForAll(Filter(...)) is the code that is broken; has following error: The requested operation is invalid. Server Response: PulledInventory failed: A value must be provided for item.
So, I want to take the info from those items in the pop up gallery (Gallery7) with the text inputs and add it all to the Excel spreadsheet table.
Any thoughts are greatly appreciated!
Solved! Go to Solution.
It's seeing it, but it is getting an error when trying to resolve it.
What kind of column is Item Name?
Perfect!!
So our issue is that we're getting the values from the PopUp gallery.
Is InventoryUsed your new Excel datasource?
What we need to do (because I see no other path back to the Gallery2 is to pass the item in the Items property of Gallery7.
From the Other post you had, I have the formula we left of with there. If you are still using that, then we just need to adjust that to the following:
ForAll(
Filter(Gallery2.AllItems, yourCheckBoxControlNameInGallery2.Value) As _item,
{ID: _item.ID,
Length: _item.Length,
Color: _item.Color,
Quantity: _item.Quantity,
'Item Name': 'Item Name'
}
)
)
Now, with that column available, then you can change the formula to the following:
Patch('Inventory Tracking - TESTING',
ForAll(
Filter(Gallery7.AllItems, !IsBlank(TextInput2_3.Text)) As _item,
{ID: _item.ID,
Quantity: _item.Quantity + (Value(_item.TextInput2_3.Text) * If(_addPressed,1,-1))
}
)
)
;
Collect(InventoryUsed,
ForAll(Filter(Gallery7.AllItems., !IsBlank(TextInput2_3.Text)) As _item2,
{
'Product Name': _item2.'Item Name',
Color:_item2.Color.Value,
Length:_item2.Length.Value,
Quantity:_item2.TextInput2_3.Text}
)
);
Set(_addPressed,false);
Set(_takePressed,false);
Set(_popup,false);
Set(isChecked,false);
Set(isChecked,true)
I see you've added a block into your Formula for Excel!!
Here is what you need though for that new section if you are creating records (rows):
Collect(PulledInventory,
ForAll(Filter(Gallery7.AllItems, !IsBlank(TextInput2_3.Text) As _item,
{'Item Name': _item.Title4, //THIS ONE CONCERNS ME...WHAT IS Title4??
Color: _item.Color.Value,
Length: _item.Length.Value,
'Quantity to Charge': _item.TextInput2_3.Text // I AM GUESSING YOU NEED TO GET THE VALUE ON THIS ONE
}
)
);
Never waste a ForAll result!!!
I made a couple of comments in the formula that should be addressed also.
I hope this is helpful for you.
So far so good. The Title4 just popped up. I want to get the "Item Name" from the SharePoint List for the item. For these items specifically, they are all the same, but for other functions, they will be different. With Title4, I was getting an incompatible type error. So I added .Text to the end of it, but it didn't pull the value I needed. I want it to pull the 'Item Name' from the SharePoint list for that item.
As for your other question, you are correct.
I hope that all made sense.
So then you are saying that Title4 is a label or something in your Gallery?
If you want Item Name from the list, then I would assume your Gallery has that value.
SO:
Collect(PulledInventory,
ForAll(Filter(Gallery7.AllItems, !IsBlank(TextInput2_3.Text) As _item,
{'Item Name': _item.'Item Name'
Color: _item.Color.Value,
Length: _item.Length.Value,
'Quantity to Charge': _item.TextInput2_3.Text // I AM GUESSING YOU NEED TO GET THE VALUE ON THIS ONE
}
)
);
I tried that, but it didn't recognize the name. Not sure why.
New issue. My original Excel file on OneDrive corrupted so I had to recreate it. Same names and everything and I deleted the old corrupted file. I also retyped out the formula for my Update button as you described above. Unfortunately, the spreadsheet is not updating with the info from the PowerApp.
Thoughts?
Well, the formula should be good...how are you adding the Excel file to your app?
So, I did some work this weekend and rebuilt the Excel sheet from the ground up. It is working now.
I still want to get the Item Name from the SharePoint List and Title4 is nothing (at least it's not returning anything).
Any thoughts of how to get that to return?
Title4 is a control I am assuming...it, by itself, will return nothing of interest.
If it's the Item name that you want, then the previous formula should give you that:
Collect(PulledInventory,
ForAll(Filter(Gallery7.AllItems, !IsBlank(TextInput2_3.Text) As _item,
{'Item Name': _item.'Item Name'
Color: _item.Color.Value,
Length: _item.Length.Value,
'Quantity to Charge': _item.TextInput2_3.Text // I AM GUESSING YOU NEED TO GET THE VALUE ON THIS ONE
}
)
);
I tried that, but it isn't finding that column name even though it definitely exists. The SharePoint list column 'Item Name' is the default column that exists when you create the list. Not sure if that has something to do with it.
In the app, I get an error. Screenshot for both things are below.
**App error
**SharePoint list
It's seeing it, but it is getting an error when trying to resolve it.
What kind of column is Item Name?
User | Count |
---|---|
259 | |
108 | |
93 | |
57 | |
40 |