I want to search the products data and show the searched data in the below as list up to 15 items if 16 item is entered than automatically the first item will be deleted.can any one help me how to do this in flutter
As you written
when we search the item in the search box it will store in the local db
So you can get only first 15 items using the same query. By that using pagination you can show remaining items. I can't get the use case of removing the top item if there are more than n items in list.
But if you want, you can do this by two ways.
First, putting items one by one in the list. Inside this loop if item count is more than 15 after inserting a new item, just remove the first item
list.removeAt(0);
Second, add the items in array, check for length. If length is greater than 15 get the remaining number & run
list.removeRange(0, );
This will remove the items from top
Related
I want get all values of dropdown and want to store them somewhere. from follwing NASDAQ site https://www.nasdaq.com/symbol/ge/historical i want get all values of Timeframe and want to somewhere so that i can use those values one b one in loop and get the values of stock for all timeframe. Click below image screenshot
It's not that easy to get each of the values, but it's not impossible. First you can get all the values in a Data Item as text. If you spy the element, you will notice that the attribute Value contains what you want. So you will need to use a read stage and get this specific attribute's value (you can ignore the PDF elements):
Doing so will give you the following:
The problem with this is that you cannot use this in a loop. One way around would be to split on space:
And the resulting collection (I called it Split Values) will look like this:
But it's not quite there yet. You should however be able to use this collection to get the collection you need (or use it directly).
If you use it directly, I would say it should look like this:
Empty? has the expression [Split Values.words]="" (notice the last row is blank)
Value is number has the expression IsNumber([Split Values.words])
Set Current Item as Number has expression [Split Values.words] with store value Current Item.
Append word to Current Item has expression [Current Item]&" "&[Split Values.words] with store value Current Item.
I have four items with tags
"AA","BB","CC" and "DD" respectively.
If I want to filter tags in
Get Next Item stage
such that items with
either tag "AA" or "BB"
get picked then what should be tag filter expression?
I tried
"+AA;+BB"
But it did not pick any item.
Please help.
In the documentation of that object you can find following information about using parameter "tag" when getting new items from the queue.
Optionally, a tag mask to filter by. This can consist of any number of
tag searches - each term can be separated by a semi-colon and they are
all applied to the search (ie. they are AND'ed terms not OR'ed terms).
For example, "Account: Joint; -Balance: Overdrawn; Card: *Visa*" will
include any items which match all the terms, ie. every item must have
an 'Account: Joint' tag applied, no item can have a 'Balance:
Overdrawn' tag applied, every item must have a tag applied which
starts with 'Card: ' and then contains the text 'Visa'.
The important part in that documentation, is that all the parameters are applied, and only the items that pass all the filters with be taken from queue. I think that what you're trying to achieve here is impossible to do in one "Get next item" action.
i would advise to do one of following:
Redesign the Tags in the process
Use Two step process of getting items from queue there. E.g. First try to find all AA's, and then all BB's.
I think you can try to filter by setting "-CC;-DD", so Blue Prism filter by searching for AA or BB but without CC and DD.
I have a hierarchy of parent child relationship in database and based on those values, I need to add new values. The hierarchy could be different and the drop down needs to be displayed dynamically. E.g. Lets say we have 2 hierarchies: NorthAmerica>USA>California and NorthAmerica>USA>GWA>Seattle. So when I try to add a new Location, if I select NA at first level, USA at second level and California at third level, then the last drop down should be of the locations which are children of California. In other case, if I select NA at first level, USA at second level, GWA at third level, then fourth drop down should show of Seattle and the last drop down should be of the locations which are children of Seattle.
The number of drop downs are shown based on the values present in the database. I doubt that it can be done using ui:repeat but I am not getting the right direction. It would be great if someone could help with any positive pointers.
If you are able to make Map<K,V> map
Where K=String(Id for value) and V= List<SomeObjectClass>
SomeObjectClass=> String id, String Value.
Now Map will looks like Key
Key Value
1 1.1,1.2
2 2.1,2.2
1.1 1.1.1,1.1.2
1.2 1.2.1,1.2.2
2.1 2.1.1,2.1.2
2.2 2.2.1,2.2.2
So if I use key 1.1 I will get list of 1.1.1, 1.1.2
One more List<ID> this will holds your selected value from drop down. And size will tell you how many drop down need to display.
Put “0” at index 0 in list, list should not be empty. Now loop over List and show number of drop down as size of list.
Dropdown value will be come from map.get(K).
UI:repeat over List<ID> var=varlistId (You know how)
Dropdown: value=#{map.get(VarID)} iteamlevel=” somevariable.level” ItemValue=”somevariable.id” var=”somevariable” DropDown END
UI:repeat END
You need to add selected Id From dropdown to list, and remove if user make any change in previous drop down, and remove all element from List.
Example:
At Page load, you list size will be 1 you have add 0 at 0 index of list, now your UI will show one drop down with map vale where you have two element 1,2;
If you select 1 or 2 from drop down, add this in list at index 1 as add method will add at last.
Now you have to drop down in UI repeat, first drop down will how 1,2 and second drop down will show 2.1,2.2,
Now if you have ten drop down and user change value in 5th drop down, now you need to loop over list and need to remove element from 6th so you list have 6 value and you UI will show only 6 drop down.
Give your suggestion below
Edited:
We can replace the map by some method which will give the next value for drop down. As suggest by #Kukeltje.
Im looking for a way to organize my shopping list for my food truck/shop better. I currently just manually keep track of my items and print my shopping list when I go to the store. However, this method prints 2 pages of my list when I only need 10 items. Im looking to add a function that would add needed food items to my "shopping list" when I enter the value needed as being more than 0. Is there a function to accomplish this?
I'm in the same situation described HERE.
I'm trying to use Create List Item and Update List Item actions (like suggested in the answer) but without any results.
Could someone kindly explain the procedure mentioned in the answer?
Thank you,
Marcello
I posted an answer there, but here is a copy in case it gets deleted or removed:
lem.mallari's answer is a huge pain unless you can assume that the Amounts in List A never change, since it's not tracking whether an item has already been added to the sum. There is no way for a Workflow to iterate through a SharePoint list, which means there is no easy way to calculate the sum or average of multiple list items.
The correct way to implement this will will require some development. The SharePoint Developer Training (2010, 2013) will actually get you most of the way there: an event receiver should trigger when items are added or changed in Lists A and B that uses SharePoint's API to go through List A and average values by Name, then update all (or just affected) items in List B. Alternatively, you can use JavaScript to display the sum of all entries in List A that have the same name as the item in List B as long as all the data is displayed on your page. If you're handy with XPath and InfoPath, you could add List A as a secondary data source to List B's form and select only applicable items in List A to sum from.
But if we're talking Workflows, here's the "workflow only" method. This was tested and successful in 2010. Create custom List C with the following columns:
Title (string, mandatory, enforce unique values)
TotalItems (integer, mandatory, default 0)
Sum (number, decimal places however you want, mandatory, default 0)
Average (calculated, =IF(TotalItems=0,0,Sum/TotalItems)) (optional)
Replace the Name columns in Lists A and B with lookup columns pointing at List C. Delete the Amount column in List B, instead including the Sum column as an additional column. Add the following columns to List A, and ensure that users cannot change them directly. This can be restricted by making InfoPath forms or by making alternative view and edit forms.
AmountArchive (number, identical to Amount, default 0)
AmountHasBeenSubmitted (yes/no, default no)
Create a Workflow to run each time an item is created or modified in List A. Use these commands (I'm using a list for readability; it was getting ugly when formatted as code):
If Current Item:Amount not equals Current Item:AmountArchive
Set Variable:Item Count to (Data source: List C; Field from source: TotalItems; Find the List Item: Field Title; Value: Current Item:Name(Return field as: Lookup Value (as Text)))
Calculate Variable:ItemCount plus 1 (Output to Variable: ItemCount)
Calculate List C:Sum (similar settings as above; be sure to use Lookup Value (as Text) and not String!) minus Current Item:AmountArchive (Output to Variable: SumWithoutValue)
Calculate Variable: SumWithoutValue plus Current Item:Amount (Output to Variable: NewSum)
If Current Item:AmountHasBeenSubmitted equals No
Set AmountHasBeenSubmitted to Yes
Update item in List C (Set TotalItems to Variable:ItemCount; Set Sum to Variable:NewSum; Find the List Item in the same way of Field:Title; Value: Current Item:Name(Return field as: Lookup Value (as Text))
Else
Update item in List C (don't do anything to TotalItems; use the same logic to set Sum to Variable:NewSum)
Set Amount to Current Item:AmountArchive