I want to check if a data item is empty or not. I am storing some values from clipboard into a data item and want to check if data item is empty or contains some text.
What I've done is determine the length:
(Len([Cost Centre])>0) AND
(Len([Quantity])>0) AND
(Len([Product Code])>0) AND
(Len([Unit Price])>0)
This is what I have in my decision stage to check if I have different items at the same time. QueueData here is a collection I retrieve from the queue. Here is a screenshot of what I have in the decision properties. It has worked for me so far:
For example, in a decision stage, you do [Item]<>"". the <> is the symbol that means not equal to in blueprism "language", so basically here you are comparing the item to an empty string.
I managed to actually solve this, it may be a little bit of a hack, but since I couldn't find a proper expression for "null", and like some of the answers here state, just the <>0 does not cut the mustard, as you end up in "cannot perform <> operation when the right-hand value is empty".
What I did was create four data items for each field you need to check against: Product code, unit price, quantity and cost centre, I set up the initial values as "0" for each of them.
Then, after "get next item" action, do a multi-calc and set these values with the values from queue items. Now, if there would be an empty item, it will not change the value, but leave it as zero, so there's something you can check against. Then during the end of that loop, you need to remember to again do a multi calc where you set these values as zeros.
As in regards to the checking the exceptions, I used "Choice" so I was able to use more detailed exception reasons (ie. what field was actually empty), and since the process ends up in two different directions (exception / Place order), you need to do another multi calc set values as zeros on the other route also.
I used IsNumber([Data.Quantity])=False. Since the format of the field is Number, comparing it to an empty text ("") does not give the right results in Blue Prism. The IsNumber() function checks if the value is a number. If the field is empty, it gives false.
Related
If I affect a full array to a ListBox, using ListBox1.List = [{1;2;3;4}] for example, the Listbox's .List items keep their correct type (here numbers), but if I use ListBox1.AddItem 5 or Listbox1.List(5) = 6 to set an individual item the type is automatically changed to String.
Sample Code:
Private Sub UserForm_Initialize()
ListBox1.List = [{1;2;3;4}]
ListBox1.AddItem 5
ListBox1.AddItem
ListBox1.List(5) = 6
End Sub
Later on, when comparing values, I get wrong results because numbers are not equals to text (5 <>"5").
Is there any easy (1) way to ensure the type of the list items is not converted to String?
(1) I know I can explicitly make the conversion to String, but I rather keep my values as numbers instead of "numbers-strored-as-text" in the listbox
I guess that will be impossible when using AddItem. According to https://learn.microsoft.com/en-us/office/vba/api/access.listbox.additem, the first parameter is a string, so everything you pass will be converted to a string.
Probably your best bet is to collect all items in an array and assign the array using ListBox1.List. Or you have to live with numbers stored as string...
Update
I mixed the pages up - link to the Access page was wrong.
Anyhow, Documentation is rather poor. It says "valid object" but doesn't define what that means. At least it is not possible to add a object - that throws a type mismatch.
Also, the documentation states that a Variant is returned, but it seems thatis not true - when I try to get the result, the compiler throws an error.
As a conclusion, I assume that AddItem converts everything to a string (and throws an error if that fails). So I still assume that you have to build up an array and assign it to List if you want to have real numbers.
I am having trouble changing the title of some columns in a pivot table. I'm trying to make them have dates in them. Each date 6 days further from the last.
Like this
But, I cannot get an equation inside the column title to stay, every time I type in the equation and press enter, it evaluates to either 0 (If the format of the cell is number or general), or 1/0/1990 (If formatted as a date). I checked the value of the cell by =ISTEXT(A1) and it evaluates as true. No matter how I format the cell. So I can never change the title to look like the picture. Any ides?
Here is what I have.
TRUE is the result from ISTEXT()
Even if I manually enter in the formula via the function arguments, it'll show up correct, but when I click ok. It will go back to either 0 or 1/0/1990
Here's the original page
https://drive.google.com/file/d/0B3p8Jm7oNAo4ZUN0Qk1mR1cxYmM/view?usp=sharing
In Excel, dynamic values (formulas) in the header of a table-formatted table are not allowed.
Instead, you can first generate your table header and then format the table as (pivot-)table. You should get a message saying that the header row will be converted in static text (with correct format).
Using Excel, lets say I have a validation list made of 5 values like this one :
Patate
Tomate
Courgette
Concombre
Patate
In a cell containing a drop down list made of these 5 value, I select the fifth value : "Patate".
I want to get in VBA that this cell contains the 5th value of my validation list. Something like :
x = Cell.Validation.GetIDValueSelected
x = 5
I can't use Vertical search because I might have 2 or even more time the same value in my list (too long to explain why).
This list is also dynamics (depending of another sheets) so it doesn't always contains 5 values.
I hope I made it clear for everyone to understand my needs but I will be glad to add more information if needed.
Thank you for your time.
Sadly, once you have used DV to fill a cell with junk, there is no way to tell which piece of junk you picked:
You would have to pad each piece of junk with a different number of blanks.
Information
I have a column of about 300 part numbers that is constantly expanding. These part numbers can be only numbers, only letters, or a combination of both. I'm using dynamic named ranges with the part numbers to fill combobox lists. When the user types in the part number in the combobox, if we've done that part before it will autofill as they keep typing. I've recently ran into a problem with this however with a recent group of parts that was added.The part number is just a six digit number, and are the only part part numbers that solely consist of numbers, every other one has letters, or if its just numbers there are hyphens in the part number. The combobox I'm filling with this named range does show these numerical part numbers in its list, but does not autofill them when the user types and does not autofill the other information associated with the part number in other textboxes when the part number is done being typed in.
Question
Can anyone help me understand why it isn't autofilling the numerical value but it fills every other value?
Code
Here is the code I'm using to fill the combobox list and the dynamic range formula. Let me know if you need anything else to help you give an answer.
=OFFSET('Part List'!$A$1,0,0,COUNTA('Part List'!$A:$A),1)
comboxPartNumber.List = Range("Part_Number").Value
List of Sample Parts
X-600-ASSY-SM
LO-5093-020-023
LO-5093-020-025
AB-1541754
764761
766415
I cannot add a comment, sice I am 2 points short :(, so I am forced to post this as a solution:
Try to make all the numbers strings.
Dim R As Range
For Each R In Range("Part_Number").Cells
If IsNumeric(R.FormulaLocal) Then R.FormulaLocal = "'" & R.FormulaLocal
Next
Let me know if it worked.
The task is simple to understand, I have a table like this:
And I would like to edit the column "L1_latitud" to collapse (or remove) all the blank cells:
It looks like a simple task but I can't find out a way to deal with it.
Not sure this is a programming question, but if what you show is a single Refine record (you can check by switching from Row mode to Record mode for viewing), you should be able to use "Join multi-valued" cells to collapse all the values into a single string with separators. From there the split(), filter(), join() methods would allow you to filter out the empty values and put the string back together. Finally, "Split multi-valued cells" would split them out into separate cells again.
I sense that you've already done some processing here, so there might be an easier way to do this if you started a step or two earlier in the process.
Create "Facet" -> "Customized facets" -> "Facet by null"
then simply exclude True choice in facet