Can I use a field name which contains a period (".") in my data source for ag-grid? - json

I have a data source which contains fields with periods in their name. e.g.
[{
"id": 1234,
"OD.name": "Andrew",
"OD.age": 21
},{
"id": 1235,
"OD.name": "Roofus",
"OD.age": 22
}]
However, when I bind this to the grid the values for columns which contain periods in their field names are not rendered. Is this a known bug/not-supported in ag-grid?

Just make sure that suppressFieldDotNotation is set to true.
From the ag-grid reference
https://www.ag-grid.com/javascript-grid-properties/
If true, then dots (eg address.firstline) in field names are not
treated as deep references. Allows you to use dots in your field name
if you prefer.

The field name is going to be interpreted by the grid as an expression, so if you provide a field name.of "OD.name", it will try to find the "OD" property of your data row, and then try to find the "name" property of that. Of course, that's not going to work.
However, you can supply a "valueGetter" function in your column definition, which will be responsible for supplying the value to the grid. In that function, you can do whatever you need to do to get the value from the row and return it.

Related

Switch function in update query

I have a table that gets appended with data. The columns are always the same. One column displays Employee_Type. When I append data it is displayed as 1, 2, 3 or 4. 1=None, 2=Employee, 3=Contractor, 4=Visitor. I want an update query to run each morning. I was trying an update query where the Update To field said :
Switch("1","None","2","Employee","3","Contractor","4","Visitor")
However, it just changes all cells to None, regardless of value. Can anyone help me, or give a better way?
You should use Choose for this:
Choose([Employee_Type],"None","Employee","Contractor","Visitor")
I'm assuming you have defined Employee_Type as Text.
Then Switch() should be called as
Switch(<employee type field>="1", "None", ...)
Since the first conditional test is
"1"
Which will always be non-zero, and therefore return True.
You have not specified which field you are testing for "1", "2", "3", "4".
Also is that field a of type Text or is it a Number?
If it is a Number, then you need to change to:
Switch(<employee type field>=1,"None", ...)

Lotus Domino data as JSON - Propertie Names

I have created a custom view in my Notes database. The view has its own column headers.
Now when I get the JSON output, the object looks like this.
"#href":"\yourdatabase.nsf\/api\/data\/collections\/name\/MYVIEW\/unid\/FF235B724095ADDAC12585F300453467",
"#link":
{
"rel":"document",
"href":"\yourdatabase.nsf\/api\/data\/documents\/unid\/FF235B724095ADDAC12585F300453467"
},
"#entryid":"1-FF235B724095ADDAC12585F300453467",
"#unid":"FF235B724095ADDAC12585F300453467",
"#noteid":"1B752",
"#position":"1",
"#read":true,
"#siblings":761,
"#form":"Person",
"eName":"Doe",
"eNAM_D":"John",
"eAddress":"Mr.",
I had thought that the property names come from the column headings.
as an example:
"Name":"Doe",
"Forename":"John",
"Address":"Mr.",
instead of
"eName":"Doe",
"eNAM_D":"John",
"eAddress":"Mr.",
Is there a way to set the properties yourself?
The name used as the property name is the programmatic name of the column (check the last tab on the column properties dialog box).
This is usually the field name if the column shows just a field. It is a computed unique name e.g. $21 if the column shows something other than a field.
You can change the name of a column that does not show only a field.
In your case, you are showing a field called eName and the programmatic name is eName. You can't change this.
You can however change the column to be a computed value that isn't just a field e.g. "" + eName and then change the programmatic name. Do not change the programmatic name to the name of another field in the database.

In SSRS, how to include first row from different dataset in tablix?

I am creating a report, the purpose of which is to print a letter to many different people. Obviously each person's name, email, etc. will be different. For this I am using a list, which I understand uses a tablix.
Now inside each letter I also need some global data that comes from a dataset. For example, the company email, telephone number, etc. This data will be the same for every letter. However, every time I try to use some expression to get this, I get an error such as:
The Value expression for the text box ‘Textbox11’ refers to the
field ‘URL’. Report item expressions can only refer to fields within
the current dataset scope or, if inside an aggregate, the specified
dataset scope. Letters in the names of fields must use the correct
case.
The expression I'm using to get the above error is
=LookupSet(true, true, Fields!URL, "SystemVars")
I've tried other things but I can't figure out what I need to make it word.
Is there an expression I can use to solve this problem? If not, what steps should I take to get my letters working?
You are missing the ".Value" portion in the expression. Try this:
=First(Fields!URL.Value, "SystemVars")

MS Access, Use Expression Builder to Compare Field in One Table to DLookup in Another Table

I'm trying to make a MS Access report, where I use a text box to display a field value, then have another text box indicating if the first value is higher or lower than an entry in a separate table.
The report has a record source of "Table 1", and a textbox named "txt_Value1" which displays the number in Field: "Value1". I have a second table, "Customer_Criteria" which has a field "PassValue" that I want to compare against. My expression builder statement is:
IIf([txt_Value1]<(DLookUp("[PassValue]","[Customer_Criteria]","[Customer] = 'ABC'")),"TRUE","FALSE")
This statement always returns false, regardless of what the correct logical result is.
I've tested it, writing:
IIf(1<(DLookUp("[PassValue]","[Customer_Criteria]","[Customer] = 'ABC'")),"TRUE","FALSE")
And I get the correct results. Also, if I write:
IIf([txt_Value1]< 1,"TRUE","FALSE")
I get the correct results. What am I missing to compare the textbox value vs. the Dlookup?
As I understand, both fields are numeric. Access may consider those fields as text, so for correct comparing use type conversion.
Try this:
IIf(CLng(Nz([txt_Value1],0))< _
CLng(Nz(DLookUp("[PassValue]","[Customer_Criteria]","[Customer] = 'ABC'"),0)), _
"TRUE","FALSE")
Nz required if fields may contain NULL values, in this case type conversion function will return error.

Add validation to numbers stored as text in Access

Field name in MS Access table - s1
data type - text
I use this field to store student marks.
'AA' will be entered if the student is absent and therefore I have selected text data type for this field
I want to restrict data entry to minimum marks = 0 and maximum = 75
How do I enter validation rule in this text field?
You may want to reconsider your decision to store the values as Text. You could store them as Numeric and just use a custom Format property to display AA when the value is Null (which is allowed when "Required=No"):
Set maximum length of the text of the field to: 2
Set validation rule to: "AA" Or Between "00" And "75"
Also, apply an inputmask to force two characters, or make sure that values between 0 and 9 are entered as 00 and 09.
In design view for your table that will store the student mark, select the student mark field.
In the field properties in the lower part of the screen set the Field Size to 2, the Validation Rule to "AA" Or Between "0" And "75" and then in the Validation Text field, write a helpful message to the user describing the valid data they can enter in to this field:
If the user tries to put in data outside the restrictions of your validation rule, they'll see your validation text message and won't be able to save their invalid data: