Is possible configurate database services with parameter from form? - orbeon

Please, I'm needing configurate the database services and parameter, this last case the parameter should come from form (/form/usuario):
SELECT name,usuario,lastname FROM Cordloc
WHERE usuario=<sql:param type="xs:string" select="/form/usuario"/>
I think that sentences maybe is not correct, can you help me?.
In the actions, I configurated "Set Response Selection Control Items" with the next values:
Items=/response/row
Label=nombre
Value=nombre
Many thank.

Related

ServiceNow Rest API (using PowerBI)

I'm on a project in which I need to get data from a ServiceNow instance and treat all data with PowerBI. I'm able to retrieve a big amount of data (Snow collect a lot of data), but I still need a way to filter data correctly. I'm calling to this URL:
Besides, I want also to apply a filter to retrieve just some specific registries from the table Requested Items. For that, I use the sysparm_query parameter to filter the field "cmdb_ci" and more specifically it's "name", something like:
&sysparm_query=cmdb_ci=What I need to Filter
Apart from this, I have also tried:
&sysparm_query=cmdb_ci.value=What I need to Filter
&sysparm_query=cmdb_ci.display_value=What I need to Filter
&sysparm_query=cmdb_ci.sys_id=What I need to Filter
&sysparm_query=cmdb_ci.name=What I need to Filter
But still not found the solution... as all these does not respond the solution needed.
Does someone know how I can manage this?
Thanks!!
JLG
There are two "Configuration item" fields in sc_req_item: cmdb_ci and configuration_item. Make sure that you are using the correct one. Either cmdb_ci.name=value or configuration_item.name=value should work, depending on which of the two fields you are using. cmdb_ci.value and cmdb_ci.display_value will not work as there are no fields on the record with these names. cmdb_ci.sys_id should work if you are supplying a sys_id (although it is redundant to type .sys_id for a reference field).
You should first verify your query through the ServiceNow UI before attempting to use it in an API call.
Type sc_req_item.list in the Filter navigator
On the filter list select "Show related fields"
Get your filter to work correctly
Right-click on the filter and select "Copy query"
The next step is to test it using the REST API Explorer.
Final step is to configure your client tool (PowerBI).

Query TFS based on value change of a field

There is any possibility in TFS UI to query based value changed of a field?
E.g.
Query all work items which have changed Automation status field to "Automated" in the past 2 days.
If the Automation status field reference the System.State (reference name), then you can try below query:
If the filed doesn't reference System.State, then we cannot achieve the requirement.
However you can custom a field and apply rules for the field to copy the value of State Change Date, something like this :
<FieldDefinition name="test" refname="test.date" type="DateTime">
<WHEN field="Automationstatus.xxx" value="Automated">
<COPY from="field" field="Microsoft.VSTS.Common.StateChangeDate" />
</WHEN>
<HELPTEXT>test</HELPTEXT>
</FieldDefinition>
Thus when you change Automation status to "Automated" for a work item, the changed date will be copied to the test filed. Then you can use the test field to filter the work items in future... but it's not available for current work items.
No there is no easy way to query on the change times of specific fields in the UI from the work item queries.
If your company has the Analytics Services turned on and available to users, then you could use Excel's Power Pivot tools to query the cube directly.
NOTE: The TFS Warehouse and Analytics Cube haven't seen major updates since their introduction in 2010 and are being replaced by the new OData based Analytics Service in Azure Devops.
I doubt there's a query parameter to satisfy your criteria entirely, but the closest I can come up with is this:

Capturing Field Name Metadata from a CSV File in Altova MapForce

I've been asked to prototype a replacement "file transformation process" (that currently is a mess of SQL) using Altova's MapForce. My input is a CSV file with headers. My problem is that I need to capture both the data AND the column name to use in downstream processing.
I need to have MapForce feed a C# method (imported as that takes two parameters: fieldName and value. I can access the value trivially, but after hours pouring over the manual (1000 pages!) I haven't found any examples of how to access the field name as an output.
The reason each output needs the field name and the value has to do with how all our mappings/transformations are currently managed - on a database. The .NET code jumps in at this point and does any necessary database lookups.
For example, if I had the following file:
"Symbol", "Account", "Price", ...
"FOO", "10101", "1.23", ...
"BAR", "10201, "13.56", ...
And a static method string TransformField( string fieldName, string value ),
I'd like to map the CSV file's Symbol data output to the method's value parameter and the Field Name "Symbol" to the method's fieldName parameter.
Some limitations:
I need to keep the "wiring" visible in the MapForce GUI. I'll have non-programmers maintaining the mappings in the future. So doing all this in code is not an option.
MapForce is the tool of choice by the company. Part of the reason our original process is such a mess is because the original programmer rolled his own mapping/transformation tool (out of TSQL no less - ouch).
We can treat all inputs/outputs to the method call as strings. Conversions will happen later.
I would like to avoid using scalar literals as inputs. I already have the column names from the file - I do not want to re-type each one and feed it to my method.
I'm not sure how many users out there have experience with this tool, but after 3 days of tinkering with it, I see much potential. If only I can get past this current sticking point, I think the company will have a solid alternative to their current mess.
Thanks for any/all suggestions.
I solved my issue and, for future reference, want to post a solution. I handled my problem by using MapForce's FlexText. This allowed me to extract the header from the CSV file and "invert" the column names as data inputs to the transformation process. Once I knew the approach to take, I was able to find more information directly from Altova.
I found a couple helpful tutorials while digging through their website:
Altova Online Videos
Web Tutorial
Hope this can help someone else in the future!

How do I prevent ASP.NET MVC from caching invalid data in my View?

I have a situation that I can't seem to find any help on. I looked through many questions on here, but can't seem to find anybody that has asked (or answered) my specific question. Here it is:
Assume I have 2 categories:
Paper (id: 1)
Plastic (id: 2)
The user clicks on Paper, change the name to Plastic, and click 'Submit'.
Inside my controller I discover that there is a already a category named Plastic so I re-sends the page to the user with a friendly message.
The problem arises when the user decides to not change the value, and instead navigate away from the page. They do some other things and then click on Paper again to change it's name. Only this time they actually see the name Plastic in the textbox!?
I have this problem on all of my controllers when I reject invalid form data. How do I fix this problem?
I just wanted to answer this question myself to indicate my question was answered by queen3 in a comment. I discovered that the value was coming back from my LinqToSql with the invalid value.
The way that I fixed the issue was by registering the Castle Windsor PerWebRequestLifestyleModule http module like so:
<httpModule>
<add name="PerRequestLifestyle" type="Castle.MicroKernel.Lifestyle.PerWebRequestLifestyleModule, Castle.MicroKernel" />
...
</httpModule>
Then I went to each component and set the lifestyle to PerWebRequest like so:
<component
id="..."
service="..."
type="..."
lifestyle="PerWebRequest">
...
</component>
Thanks queen3!

Filter a Data View Web Part by "last 3 days"

We have a custom list that has a column called "Connection Date" and need to display the most recent list items (relative to this "Connection Date" column) in various places across the portal. the Data View Web Part appears to be the best solution, but I'm having difficulty finding the right method & syntax to filter by date.
I can create a parameter and filter by a value for another column. I can filter by a specific date. I can't seem to figure out how to say "Show me all list items where 'Connection Date' is in the range of [Today] and [Today]-3".
Is this possible? Does anyone know how to do this?
Thanks!
if you use CAML, you can do it.
<Where>
<Gt>
<FieldRef Name="Created" Nullable="True" Type="DateTime"/>
<Value Type="DateTime"><Today OffsetDays="-7"/></Value>
</Gt>
</Where>
thanks a bunch. between this response and this blog we were able to get this figured out.
http://blogs.msdn.com/sharepointdesigner/archive/2008/02/25/filtering-and-formatting-with-date-values.aspx#filter_list_on_today_offset

Resources