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.
I'm honestly not sure. Here are some more screenshots to hopefully help.
**Format columns
**Format view
Go into the list settings of your list and look at the column definition for Item Name
By the way...I accidentally hit accept solution when trying to hit the next page...you can remove the accept solution from that post. Sorry about that...
No worries!
The column is labeled as Title and it's a Single Line of Text.
And Title in the app is giving an error.
Let's look at it from another perspective. Put your cursor at the end of Gallery7.AllItems and then type a period and see what all of the items are that come up in the formula editor for you. Look for Title, Item Name, etc. and see if you see that in there.
I couldn't see anything in there. All of the items that popped up were as follows:
Color, ID, Label4, Label6, Length, Quantity, Separator5, TextInput2_3, and Title4.
Something odd at play, but I can't see the entire formula. Can you post back with the formula as text?
(A code block from the menu above your reply)
Also, what are the Gallery names again? Main one and Popup one?
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,
{
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)
The main gallery is Gallery2 and the popup gallery is Gallery7.
Thanks for all the help!
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)
Worked perfectly! I had to adjust the formula just touch. Instead of 'Item Name':'Item Name', I had to adjust it to be 'Item Name':_item.Name. But after that, it worked.
I'll probably be posting again soon. Hah! Thanks again for all of your help!