How to apply query / filter on a datasource related to the currently selected datasource? - filtering

Case:
I have 3 datamodels:
Tasks
Sub-Tasks
Status
The models are related in the following way: Tasks have a many-to-one with Statuses, same applies to Sub-Statuses. Some e.g. statuses are: To Do, Doing Done etc.
I can filter all Tasks using a dropdown with a set value of: "#datasource.query.filters." so that I select an option, only the records that have the specific value are shown.
I cannot use query on related datasources. E.g. if I want to apply query on "Tasks:Sub-Tasks(relation)", in order to filter the sub-tasks by their status (Sub-Tasks:Status(relation), query is missing as an option.
How can I achieve this? How can I apply a filter to related to the currently selected record items based on a specific to them attribute?
Case 2
How can a list based on multiple relationships be set up?
3 datasources:
Stages
Statuses
Tasks
Tasks pass through stages, with its status changing along the way as well. E.g. Task can be in planning stage with status to do, doing or done.
Please refer to the added screenshot for an interface example.

This is only one possible solution. But I would suggest the following:
Create 3 datasources within Tasks Model, SubTasksToDo,
SubTasksDoing, and SubTasksDone.
Within each datasource set the type to 'Query script' and add a
parameter (type string or number depending on what your task primary
key type is), call it 'MainTaskKey', and for each datasource uncheck
the autoload option.
For each datasource enter a query script of:
query.filters.YourMainTaskRelationEndName.id._equals = query.parameters.MainTaskKey;
query.filters.Status._equals = 'To Do'; //replace with 'Doing' or 'Done' depending on which datasource you're working in
Go to your Main Tasks datasource and scroll down finding the
onItemChange client script and enter the following in the code
block:
var itemKey = datasource.item.id;
var todo = app.datasources.SubTasksToDo;
var doing = app.datasources.SubTasksDoing;
var done = app.datasources.SubTasksDone;
todo.properties.MainTaskKey = itemKey;
doing.properties.MainTaskKey = itemKey;
done.properties.MainTaskKey = itemKey;
todo.load();
doing.load();
done.load();
Then go to your page an insert a panel for each of the 3 SubTask
datasources and put in a table or whatever you need.

Related

How to set conditions to avoid duplicate run for Tasks creation for a User Story

I created a Power Automate flow to create 9 tasks (Dev, Testing, and BA tasks) as a child for a new user story when it is assigned.
It works fine but it is getting duplicated every time when the story is assigned back from Unassigned to a resource.
I tried to get the count of related tasks for the user story before creating them but couldn't find any default conditions to get that.
Is there any other condition to set to avoid this duplicate task creations?
Solution for the query to set a condition to check for the existing workitems before creating them has been provided by yashag2255 on the Power Automate forums:
To get the work items related to the user story, you will have to send a HTTP request for that. But before sending this request -> Go to Azure DevOps -> Queries -> My Queries -> Create a new blank query and save it. (In this example let us say TestNew).
After you have done this, in the flow under the trigger create an action as shown. Very carefully populate all the fields. (here 'yashTest' is my project, replace it with yours)
Body : {
"name" : "TestNew",
"queryType" : "tree",
"wiql" : "SELECT [System.Id],[System.Title],[System.State] FROM workitemLinks WHERE([Source].[System.WorkItemType] = 'Task' AND [Source].[System.Id] = )AND ([System.Links.LinkType] = 'System.LinkTypes.Hierarchy-Forward')AND ([Target].[System.WorkItemType] = 'Task')MODE (Recursive)"
}
in the "wiql" near the [System.Id] = select the ID of the work item retrived from the trigger action (the original trigger request that has the id of the assigned work item)
Now, create a new string variable to get the query ID and put the foloowing expression in the expression editor and add it to the string value.
body('Send_an_HTTP_request_to_Azure_DevOps')['id']
Now add another action: Get Query Results with the query ID in the previous step. This will fetch you a list of the work items related to the assigned work item. You can iterate thorough this to check if the items exist and if not create them with Create Work Item Action.
Source: https://powerusers.microsoft.com/t5/Building-Flows/How-to-set-conditions-to-avoid-duplicate-Tasks-creation-for-a/td-p/289629

Oracle BI: how can i retrieve another result list from current result list

I am using Oracle Business Intellgience (12c) and let's say I have a report resulted from an execution of the following query
select code_filial, max(paid) as maximum_pay
from leads_history
group by code_filial
It will return a table with highest budget value related to the each filial. Now what i want is the following: when i click to max(paid) result in a table, another table should appear with the information about max(paid) account. I tried master-detail relationship, but couldn't succeed.
Can anyoune help with that?
That's out-of-the-box functionality. As soon as you make a navigation action link to another analysis where your code_filial is set to "is prompted" the context will be passed and the analysis filtered.

Update chart after changing a field in an APEX form

How do I cause APEX to refresh a chart (graph) after I change the value in a text box/select list/etc that is used as a parameter in the chart's pl/sql statement?
I'd like it to look as professional as possible and minimize the portion of the page that must be refreshed (i.e., "ajax-like", which is the standard in 2018).
Create a dynamic action on the text box/select list/etc that is changed with event "change"
Create a true action and select pl/sql and write
Begin
null;
end;
In page items to submit select your items
Create a second true action after the first and select Refresh. Then select region as affected element and select your chart. Remember that the option 'Fire on initialization' must be set to NO
See Approach B, below, for the optimal solution.
Approach A
The simplest option (that is less professional) is to modify every text box/select list/etc of interest to submit the page when the value of the text box/select list/etc changes. As an example, for the select list, go to its settings->page action on selection and change the setting to submit page.
There are two main downsides to that approach:
Most of the page will refresh, which is jarring to your user, and
If you're using a plugin, or the type of item that you're using doesn't support that approach, then you're out of luck.
Approach B
A more complex solution that yields a more professional result follows. This solution involves dynamic actions, which I will probably not fully explain here. However, the information should be enough for the user to figure it out.
Let us suppose that you have two things: (1) a select list whose value is used as a parameter in a (2) chart's sql source statement.
To get the chart to update every time you make a new choice via the select list, you need to:
Create a dynamic action for the select list of interest. You do this by clicking on the select list, going to the dynamic action tab (the lightning bolt); right-click on the item; click select dynamic action; give it a name and set the event to change and make the selection type an item and set the item to the name of the select list you're watching.
Create a true action for that dynamic action that executes pl/sql code (you can do this by modifying the show action that was created by default in 1.). Set the pl/sql code to null;. Then under items to submit, specify the name of the select list of interest.
Create a second true action that refreshes the region that contains the chart.
You'll need to make sure that the sequence assigned to 2. is a smaller number than the sequence assigned to 3.. This should happen by default, but it's an area you can get tripped up.
Inapplicable Approach C
In Apex 5.something, they added a feature called Cascading List of Values. This feature allows you to specify that one item depends on another item for its values. For example, if you have a select list that allows the user to choose a department, and then you have a second select list that allows you to choose an employee from the chosen department (which presumably obtains its values from a query involving the value chosen in the first select list), you can tell APEX to refresh the second select list whenever you update the first.
You do this by editing the second select list. Under its settings goto list of values->cascading LOV parent item(s). Add the first select list as a "reverse" dependent (aka, "parent"). This will ensure that any time the first select list is updated, the second select list is also updated.
For better or for worse, charts do not have the cascading LOV parent item(s) setting. Thus, this solution does not apply to this question.

Filtering a list lookup in Nintex Forms using an inline function

I am building a list form for SharePoint 2010 using Nintex Forms 2010.
The user must select an item from a different list, so I have added a List Lookup control. But the user can only select among items that starts with a specific string.
For example, the lookup list could contain items with titles 'foo1','foo2','bar1','bar2'. I only want the user to be able to select 'foo1' or 'foo2'.
In the filtering section of the List Lookup control I have specified the following:
Filter available selections = By a specific value
Where field = fn-Substring("Title",0,3)
Filtered by value = foo
Unfortunately this does not result in any options for the user to select - just an empty control.
If I change the filter to:
Where feild = Title
Filtered by value = foo1
Then I get the foo1 option - and only that one. Trying something like
Filtered by value = foo*
does not work either.
So how should I define the filter to get it to work. Or is what I am trying not possible in Nintex Forms?
The inline function won't work in your case, because it is a client side function, and your parameter is a server side object.
There two alternative ways can help with your request in server side.
1.Add a calculated value column to your list, use LEFT function to cut the search key for yourself:LEFT([Title],3). In nintex form, you can use this column to filter the list items.
Filter the list items in a view instead of nintex form. Suppose you have already known the [source view] property in List Lookup control.

Create a new FileMaker layout showing unique records based on one field and a count for each

I have a table like this:
Application,Program,UsedObject
It can have data like this:
A,P1,ZZ
A,P1,BB
A,P2,CC
B,F1,KK
I'd like to create a layout to show:
Application,# of Programs
A,2
B,1
The point is to count the distinct programs.
For the life of me I can't make this work in FileMaker. I've created a summary field to count programs resetting after each group, but because it doesn't eliminate the duplicate programs I get:
A,3
B,1
Any help much appreciated.
Create a a summary field as:
cntApplicaiton = Count of Application
Do this by going into define fields, create a field called cntApplication, type summary. In the options dialogue make the summary field a count on application
Now create a new layout with a subsummary part and nobody. The subsummary should be sorted on Application. Put the Application and cntApplication fields in subsummary. If you enter browse mode and sort by Application you ought to get the data you want.
You can also create a calc field with the formula
GetSummary(cntApplication; Application)
This will allow you to use the total number of Applications with in a record
Since I also generate the data in this form, the solution I've adopted is to fill two tables in FileMaker. One provides the summary view, the other the detailed view.
I think that your problem is down to dupliate records and an inadequate key.
Create a text field called "App_Prog". In the options box set it to an auto-enter calc, unchecking the 'Do not replace...' option, and use the following calc:
Application & "_" & Program
Now create a self join to the table using App_Prog as the field on both sides, and call this 'MatchingApps'.
Now, create (if you don't alread have one) a unique serial number field, 'Counter' say, and make sure that you enter a value in each record. (Find all, click in the field, and use serial number option in'Replace Field Contents...')
Now add a new calc field - Is_Duplicate with the following calc...
If (Counter = MatchingApps::Counter; "Master Record" ; "Duplicate")
Finally, find all, click in the 'Application field, and use 'Replace Field Contents...' with a calculation to force the auto-enter calc for 'App_Prog' to come up with a value.
Where does this get you? You should now have a set of records that are marker either "Master Record" or "Duplicate". Do a find on "Master Record", and then you can perform your summary (by Application) to do a count of distinct application-program pairs.
If you have access to custom functions (you need FileMaker Pro Advanced), I'd do it like this:
Add the RemoveDuplicates function as found here (this is a recursive function that takes a list of strings and returns a list of unique values).
In the relationships graph, add another occurrence of your table and add an Application = Application relationship.
Create a calculated field in the table with the calculation looking something like this:
ValueCount(RemoveDuplicates(List(TABLE2::Program)))
You'll find that each record will contain the number of distinct programs for the given application. Showing a summary for each application should be relatively trivial from here.
I think the best way to do this is to create a separate applications table. So as you've given the data, it would have two records, one for A and one for B.
So, with the addition of an Applications table and your existing table, which I'll call Objects, create a relationship from Applications to Objects (with a table occurrence called ObjectsParent) based on the ApplicationName as the match field. Create a self join relationship between Objects and itself with both Application and Program as the match fields. I'll call one of the "table occurrences" ObjectsParent and the other ObjectsChildren. Make sure that there's a primary key field in Objects that is set to auto-enter a serial number or some other method to ensure uniqueness. I'll call this ID.
So your relationship graph has three table occurrences:
Applications::Applicaiton = ObjectsParent::Application
ObjectsParent::Application = ObjectsChildren::Application, ObjectsParent::Program = ObjectsChildren::Program
Now create a calculation field in Objects, and calculating from the context of ObjectsParent, give it the following formula:
AppCount = Count( ObjectsChildren::ID )
Create a calculation field in Applications and calculating from the context of the table occurrence you used to relate it to ObjectsParent with the following formula:
AppCount = ObjectsParent::AppCount
The count field in Objects will have the same value for every object with the same application, so it doesn't matter which one you get this data from.
If you now view the data in Applications in list view, you can place the Applications::Application and Applications::AppCount fields on the layout and you should get what you've requested.