I need to store "x" in Item Data.Equipment Requirement.Tariff.0
Item Data is a collection which has a field of type collection "Equipment Requirement"
Equipment Requirement is a collection which has a field Tariff and filled with 6 rows.
I am sure that there is no naming errors, but each time i store something in Item Data.Equipment Requirement.Tariff.0 i got and error:
Internal : Could not store calculation result - Field Item
Data.Equipment Requirement.Tariff.0 not found
Blue Prism's dot notation only has the capability to refer to collection fields, not specific row indices. Use the Utility - Collection Manipulation VBO's Set Collection Field Action:
Business Object: Utility - Collection Manipulation
Action: Set Collection Field
Inputs:
- Row Index: 0
- Collection: Item Data.Equipment Requirement
- Field Name: Tariff
- Value: "35"
Outputs:
- Updated Collection: Item Data.Equipment Requirement
Related
I needs to update the Mongodb whole collection according to the data on my website.
Schema({ title: "data" }).which_function_should_I_call
when I call the first time it has 20 data item update the collection 20 documents - collection documents length should be 20.
after the second call data has 5 data item the collection length should be 5 documents.
I have 2 collections in which I get data from DB.
Collection 1 column names: A_id, Bid, PCid, Bname ==> all text fields
Collection 2 column names: A_ref, Cid, Cname, value ==> all text fields
Collection 1 and 2 are related based on collection1.A_id=collection2.A_ref
I have a 3rd collection which is a nested collection:
Collection 3 Column names: action(text), colA (collection)
colA column names: Bid(text), PCid(text), Bname(text), colB (collection)
colB column names: Cid, Cname, value ==> all text fields
I want to join collection 1 and collection 2 based on mentioned condition to load the nested collection 3.
Please help.
I have tried using the collection VBO but didnt succeed. I also tried using a nested loop stage and counters with a decision stage but my code fails to add empty row to the nested collection before populating the values.
Using Blueprism stages
I want to join collection 1 and collection 2 based on mentioned condition to load the nested collection 3.
I am using a nested loop stage and counters with a decision stage but my code fails to add row to the nested collection.
Aswin, please check the solution below:
For further information, i will pass the XML file as for you to import to Blue Prism and check every stage, since it would require a lot of time and screenshots to explain everything. Plus you will have a clear understanding of every step in your environment.
Download XML file from my github repository link:
Blue Prism Merge Collections to populate a nested-collection
Hope these information will be useful.
I believe what you're looking for is what I call a "box join". You'll need a code stage.
Inputs:
Main (collection)
Nested (collection)
Main Key (text)
Nested Key (text)
New Field Name (text)
Outputs:
Output Collection
Code:
' Check for requirements: key columns exist, and that the new field to create in the main
' collection does not already exist.
If Not Main.Columns.Contains(Main_Key) Then
Throw New Exception("Main Collection does not contain the key column '" & Main_Key & "'")
Else If Not Nested.Columns.Contains(Nested_Key) Then
Throw New Exception("Nested Collection does not contain the key column '" & Nested_Key & "'")
Else If Main.Columns.Contains(New_Field_Name) Then
Throw New Exception("Main Collection already contains a field named '" & New_Field_Name & "'")
End If
' Add the column containing the DataTable which will be populated with data from the Nested collection.
Main.Columns.Add(New_Field_Name, GetType(DataTable))
For Each MainRow As DataRow In Main.Rows
' Create the new nested table for this row and populate the column names.
Dim Table As New DataTable
For Each NestedColumn As DataColumn In Nested.Columns
Table.Columns.Add(NestedColumn.ColumnName, NestedColumn.DataType)
Next
' Because we don't want to copy the key column.
Table.Columns.Remove(Nested_Key)
' Check each row in the Nested collection to see if it matches current key.
For Each NestedRow As DataRow In Nested.Rows
If MainRow(Main_Key) = NestedRow(Nested_Key) Then
' Got a match; add the row from Nested into the new table.
Dim NewRow As DataRow = Table.NewRow
For Each TableColumn As DataColumn In Table.Columns
NewRow(TableColumn.ColumnName) = NestedRow(TableColumn.ColumnName)
Next
Table.Rows.Add(NewRow)
End If
Next
' Set the nested collection
MainRow(New_Field_Name) = Table
Next
Output_Collection = Main
Using the example from the question, you'll want to pass the following into the code stage inputs:
[Collection 1] -> Main
[Collection 2] -> Nested
"A_id" -> Main Key
"A_ref" -> Nested Key
"colB" -> New Field Name
The resulting Output Collection will contain the fields from Collection 1, with an added column "colB" which contains the fields (excluding the key) from Collection 2. From there, a calculate stage can get the results into Collection 3.
I've created a search that shows current inventory on hand, their purchase price, and a formula that multiplies the two to have current value.
In the results field I want to have a column that shows the last time an item was on a sales order. but i am coming up short. Is there a way to do this?
Filter Criteria
Results Criteria
Criteria -
Inactive - FALS
Type - Inventory Item
Transaction Field: Type - Sales Order
Available - Is greater than 0
RESULTS -
Name - (Summary Type Group)
Description - (Summary Type Group)
Available - (Summary Type Count)
Transaction Fields - Date (Summary Type Maximum)
Did you create the saved search from the Item Record or Transaction Record?
If you created it from the Transaction Record then you will want to make sure to use the Date Field and Summary Type (Results tab) as Maximum.
Field = Date
Summary Type = Maximum
If you created the saved search from the Item Record you will need to use the Transaction Fields... table join to bring in the Transaction Date field.
Alright, here's my scenario :
I have 2 custom lists : Orders and Items. The Items list contains a field Description (text) and a Amount Per Item field (calculated). The Orders list contains a Total amount field and a Items field (lookup on the description field in items which allows multiple values selection).
Here's a more visual explanation :
Orders
Total amount
Items (lookup on the description field in items which allows multiple values selection)
Items
Description (text)
Amount per Item
I would like to do the sum of the Amount per Item field of the selected items from the Items lookup field from Orders and put the value of the sum in the total amount field in Orders
Any suggestions? Is it possible to do this in SharePoint 2010 without code? If not, could you show what the code would look like?
Thanks.
You could try
OrderList.Total = OrderList.Items.Sum(item => item.AmountPerItem);
I am trying to update a Lookupvalue field "Items" via the SharePoint object model.
"Products" is a column in one list which is used as a lookup column to another list in field "Items".
In my webpart i have dropdown of Items now
string strItems = ddlItems.SelectedValue.ToString();
item["Items"] = new SPFieldLookupValue("strItems");
item.Update();
However, this is causing an error
Internally, SharePoint stores these references like this:
NumericID;#DisplayValue i.e.
145;#Soup
12;#Cake
874;#Steak
That is the kind of thing that should be in the constructor to SPFieldLookupValue. Or if it is more helpful, use the variant of the constructor that takes an int id and string display value.
More info is laid out here:
http://blogs.msdn.com/b/sridhara/archive/2007/08/25/update-quot-lookup-quot-fields-in-sharepoint-2007.aspx
You need to set the Items column to the ID of the SPItem represented by the product. You could do this by setting the DataTextValue of your dropdown to ID and then using the SelectedValue. You could also do a CAML query when a new item is selected in the dropdown.
You can find more information at the bottom of this blog post:
http://weblogs.asp.net/bsimser/archive/2005/05/13/406734.aspx