Incompatible parameter Type, Workshop Actions - palantir-foundry

I am trying to configure an action to create an instance in an object. But when I am giving an object reference for one of the properties in the form, it says Incompatible parameter types.
I checked the datatypes of these 2 strings and both of them are 'string', not sure why this message is getting displayed and I am not able to save my edits in ontology as well.

Related

How to set up a link from a column value to a linked object?

I would like to set up a hyperlink from a foreign key column in the backing dataset of object type A to the respective object of type B.
Following an existing and working example, in the dataset preview, I have added a type class in the form of {{object type B id}}.{{object type B's property id}}. However, this is not giving me a link. Do I need to format this differently or are there any additional configurations required?
Further investigation revealed that in addition to the type class described in the question, this also requires a configuration change by a Palantir representative.

Angular 4 - BehaviourSubject not returning json data properly

I'm trying to creating a global service in angular app with BehaviorSubject.
I have created a method in this service where I have defined a HTTP get method and loading JSON file.
Now the issue I'm facing is when I'm subscribing this BehaviourSubject as asObservable in any component and assign the result to a particular variable in the typescript file, the HTML template renders this value correctly via structured Directive *ngFor but when I'm trying to get the same value in typescript file, it does not work.
For example;
When I'm trying to print this value
console.log(this.data.boxes.length);
then it gives me an error
[ERROR TypeError: Cannot read property 'length' of undefined]
and when I'm trying to print this value without length
console.log(this.data.boxes);
it gives me a proper value of an array in the console panel.
Now If I change BehaviorSubject to Subject, then its working fine means I am also getting length value.
However, I want to use BehaviorSubject instead of Subject.
What am I doing wrong and how can I achieve it?
Behavior subject is emitting current value to subscriber even if subject next is not called before subscription, in other words:
yours subscription is subscribed to subject before first "next" value. I assume that initial value of behavior subject is undefined or similar, so that first value that is emitted to subscriber is causing error.
Could you check declaration of subject and ensure that initial value is in correct form, like:
public exampleSubject = new BeahviourSubject<yourType[]>(<yourType[]>[]);

how to bind input text and combo box in angularjs 1

I have two controls in a form.
zip code - (input type text) and city - (select options)
The back-end rest service sends json object which will contains zip codes and city names. I want to change city when zip code changed and vice versa using angularjs1. Also validate zip code with json object.
please help me...
Alright. So I am assuming that you have a serverside script from which you can get both city from pincode and pincode from city
Now you have got 2 controls in your view.
1) Input Box
2) Combobox
Now The easiest way according to me is that you should make a function that is called on ngChange event of both the controls.
That function would make a request to your server and fetch the associated data and feed the data to the other control.
Now when you populate the controls internally through the controller, it might again fire an ngChange function. So in each ngChange function you must have a reference of the desired values for them. That can be done by storing both the latest values received from server side into a local variable and checking it each time the function is called.
I believe this would solve your problem.
----------------Update----------------
As mentioned in the comment, the SPA shall not be sending request to the server during the execution. It shall simply send the json at the end.
So for that its more convenient. Simply make 2 different functions, 1 getCityFromPincode(pincode) and 2 getPincodeFromCity(city)
Now you can easily do your operations in javascript on the basis of the values that you will get from the ngChange() function.
Just call the function getCityFromPincode in the ngChange function of your CITY INPUT Control and similarly for the other one.
You would probably make it through with this approach.

Enummerate Field Names In Swagger

So I have done some hunting around online, and have been able to figure out how to use the enum tag in a swagger doc to specify a list of possible values for a field. However, in my current API what I need instead is to have a list of potential fields, each of which has a string value.
To be more precise, I have a POST request that sends JSON in the request body. As part of this request users need to send a single ID field. However, we accept multiple types of ID fields. So the request would look something like this:
{name:"name", product:"product", [FirstIdType, SecondIdType, ThirdIdType]:"ID Value"}
So I need to have the user submit a JSON that has a name, product, and one of FirstIdType, SecondIdType, or ThirdIdType. Technically it is required to have exactly one of those three ID types in the request, but I don't really mind if that isn't possible in the swagger doc. Noting it in the description for the field is fine.
The other constraint is that I can't really change the design at this point. The app has already been built using this design and changing it is out of my hands. Which means that I can't just make an array of ID Types and then choose one of them.
Here is the relevant bit from my swagger doc. The area that needs changed is the ID field. Any thoughts or directions on how to get that to go forward would be really appreciated.
definitions:
request_post:
description: (post) request schema
properties:
name:
type: string
product:
type: string
Id:
type: string
Instead of defining what optional fields can come on the path, you can label the fields that are required and make the rest variable by default.
http://swagger.io/specification/#parameterObject
required boolean Determines whether this parameter is mandatory. If
the parameter is in "path", this property is required and its value
MUST be true. Otherwise, the property MAY be included and its default
value is false.

Custom code in Reporting Services report

In Reporting Services I would like to add a parameter that contains data from a custom code block. Ideally, I would be able to run the following code (this is a simple testing example):
Function GetPeriods() As String()
Dim values As System.Collections.ArrayList =
New System.Collections.ArrayList()
For i as integer = 1 to 24
values.Add(i)
Next
Return values.ToArray()
End Function
and put the following in the "Text Field" of the parameter:
=Code.GetPeriods()
However, when I run the report, the parameter I apply this to is disabled and empty. Is there a different technique that should be used? Or am I doing something wrong?
If you're using SQL 2008 Reporting Services then you can have a look at this page which introduces the concept of using custom assemblies.
If you're using SQL 2005 Reporting Services then this link is the one you want.
It's a mostly trivial thing, simply compile your code into a class library and follow the instructions provided to allow your report to reference it.
You are returning an array item (an array of strings) into a text field. Instead, try returning a plain string. That should work. If you would still like to return an array list, you must basically bind it to a list control in your RDL. You can definitely do that with dataset extensions. However, I am not sure if there is any other easy way. Check the proprties of the list control and see if it allows you to directly bind to an array list.
You can create the same stored procedure on SQL Server and load parameter values from that procedure.
To access your members/functions implemented in custom code of SSRS report you should set the access modifier to "Public":
Public Function GetPeriods() As String
...
see article Writing Custom Code in SQL Server Reporting Services
I've been trying to do this same thing, set a simple list of parameter values from report code. None of the links in any of these answers shows how to do this and after quite a bit of digging around I don't think it's even possible. Yes it is possible to get the values from a database query, from a web service, or from a custom assembly, but each of these creates a lot of overhead compared to getting the list from a simple function call like =Code.GetValues(), where the function uses a For loop to create the values.
msvcyc is correct in pointing out that the parameter is expecting a string value, but the function is returning an array. I changed the return type to Array as suggested by prashant sable, but the select list is still grayed out, it does not work. And coldice is correct in saying that the access modifier should be Public.
In my digging around I found an article by James Kovac from 2005 that pointed out why this is not possible. The Parameters class has a get method, but no set method. In the VS 2008 object browser for SSRS 2008 the object name has changed, but it still does not contain a set method (see Microsoft.ReportingServices.Interfaces.IParameter.Name or .Value).
My current workaround is to just hard code the list of values, but if your value list needs to be dynamic then your only choices are database queries, web services, or custom assemblies. I think the easiest workaround of these three is to get the values from the database engine, as suggested by oleksiy.t, as long as you can write a query to return the value list you want. Your list of integers, or my list of time intervals, would both be easy queries to write. Otherwise you will need to use one of the other two workarounds.
I checked your code. The only thing that's wrong is your function returns String(). When I changed your method signature to return Array, it worked fine, in my report.
Change the signature to Function GetPeriods() As Array
Everything I've seen requires parameters and their respective settings to be part of the RDL.
That being said, if you're going to "hardcode" the values, you could create a dataset just for the report, perhaps in XML, or if it needs to be programmatically driven, do it in a web service.