Adding values from TinyDB - app-inventor

So I have a TinyDB with time as a tag and data from Bluetooth as a value,
I want to find a way to sum all the values and store as a variable.
A possible way to do that is create a empty list and sum each item in that list, but how do I create a list with only values from TinyDB and without tags in it?

Here is some code that will add up all the values in a database.
It uses a for each item block with the get tags block.
Inside that loop, it adds the value of the tag to the sum.

Related

Table Extraction in UIPath if table has images

I am trying to extract the Table which has the following format
When I want to extract i should have either put some character on place up icon or i dont want that either the case is fine..
But UIPath brings this way.. 78,59,237806 all as one text which is misleading.. How to resolve this issue..
Thanks
Take a look at the Find Children activity. You can specify an item via selector (the table) and use Find Children to return a collection of type UiElement.
So set the filter to extract the "<webctrl tag='tr' />" which will effectively give you a collection of the rows.
Use a For Each to iterate through each UiElement you got from the first Find Children activity, and use that element to run another Find Children. In this case, set the filter to extract the elements with a class of "mid-wrap". This gives you a collection of the elements in the row which match that requirement, and this will exclude the data-up value, since that's a different class.
You can then loop over this collection to get the innertext attribute, which will give you the actual values you're looking for each cell in the row. Use something like Add Data Row to add the values to a datatable, and let the For Each run over the next row in the collection.

Get changes for an item or a file (properties only)

How can I loop thru all changed columns in a sharepoint list.
I use the
TRIGGER "When a item or file is modified" and then the
ACTION "Get changes for an item or a file (properties only)"
I thought I can loop thru the dynamic content "Column has changed" (A Collection showing which columns have changed)
But this is not a list of changed columns, this is a Object with all columns in the SP-List an a Status "true" or "false" if it is changed or not.
What I want to do, is to loop thru all changed columns and use SWITCH to define next steps per column.
Unfortunately there is no graceful way to do this as of now. However you can achieve this by keeping a reference of all your columns from SharePoint list.
Initialise an array variable ColumnNames and fill all your column names from SP list as it's input. I am taking top 4 columns from your setup. ID, Title, Ticketno, Service_Type
Initialise 2nd Array variable ChangedColumns to collect your changed column names. See the first image below.
Now use a for loop and iterate over ColumnNames and put a condition to check if current item (which will be the column name) value is true or not. If that's true then add it to ChangedColumns array, which we initialised to collect changed column names. The expression you need to use in condition is written as comments in the image itself.

Build a view-sum row programmatically in Drupal 8

I have a table view with two numeric fields and some rows.
First task is, to build a third field where the two fields are multiplicated.
It is no problem for me, to build the sum with views_pre_render(\Drupal\views\ViewExecutable $view).
But i don't find a solution to get this new field in frontend.
Should I overwrite a given field of the node in view or should i build a new field?
And the second task is, to build a sum over all rows of the new field an output it in footer.
I am seeking for ours the different view-hooks in API but don't find the solution.
Could you please give me some hints?
I put a new field to the content type with default 0.
And with mymodule_entity_presave(Drupal\Core\Entity\EntityInterface $entity) i did the multiplication of the other two fields and updated the new field with this value.
Put the new field to view and now I have the multiplicated value.
Next step is to build a sum row with total sum of the new field.
I would like to build a new Variable for Twig with a preprocess view-Function.
I tried this one mytheme_preprocess_views_view_table(&$variables), becaus it is a table view.
But i cant get the raw value in the foreach loop of the result.
What would be the best solution?

How to create a Range from Table in schematiq

I have a schematiq table containig data I have read from a CSV and parsed into columns. I want to create myself a data link to a range object representing each column so I can then pass those into multiple stats functions.
I've tried =rng.Subset(B5,1,1) on the table which I had hoped would create a range for the first column, but in the views I see I this results in a 1x1 range containing the whole table.
What's the correct syntax?
When you return an array from a Schematiq function, there are two possible forms for that array to take. One is a "range", i.e. a data-linked object that will exist in a single cell regardless of its size, the other is an array function result, which will fill whatever range an array formula has been entered in.
The easiest way to get all the values out of a table as an array is to use tbl.GetValues(), which if you use it without a column argument just returns a rectangular array containing all the data in the table.
However, this is returned as an array function result, so in order to put it into a range you will need to use rng.Create() on that result. The following should work for you in this case:
=rng.Create(tbl.GetValues(B5))
Or, for a specific column:
=rng.Create(tbl.GetValues(B5, "ColumnName"))

How to identify a Specific WebElement which is a child of WebTable in UFT

I have a WebTable, which has some WebElements. I want to verify the text of one of the WebElements and take action on it. Can you help, how to proceed on this?
As Vinoth said if you know which row and column the element is in you can use ChildItem.
Typically UFT flattens the elements (so that a WebElement in a WebTable will appear as the WebTables sibling if both are added to the repository. However something that many people do not know is that if you manually put an element under the WebTable (or any other element) then UFT will look for it under the parent object.
This means that you can describe the nested element and UFT will only look under the table and not in the rest of the page.
Browser("B").Page("P").WebTable("T").WebElement("innertext:=.*bla.*").Click
You can use ChildItem method of WebTable.
Set MyWebElement = Browser("CreationTime:=0").Page("micclass:=Page").Webtable("name=TableName").ChildItem(Row, Column, micclass, Index)
Row - Required. A long integer value.
The row number where the cell is located. The first row in the table is numbered 1.
Column - Required. A long integer value.
The column number where the cell is located. The first column in the table is numbered 1.
MicClass - Required. A String value.
The object type.
Index - Required. A long integer value.
The index of the object of type MicClass in the cell. This index indicates the desired element when there is more then one object of type MicClass in the cell. The first object has an index of 0.
MyWebElement is the element you wanted. You can access any methods/properties of WebElement. For ex, to click,
MyWebElement.Click

Resources