In angularjs, using ngOptions, how do I get both the object from the array being iterated over and its index in the array - angularjs-ng-options

Looks like it's possible from this:
"Using 'select as' will bind the result of the select expression to the model, but the value of the <select> and <option> html elements will be either the index (for array data sources) or property name (for object data sources) of the value within the collection"
But I can't figure out how to get 'the value of the <select> tag'

Related

Azure ADF Lookup a distinct list for a following 'For each activity'

I'm using a Lookup activity to get a list of values from a csv file. I want to want to loop through a distinct list of one of the columns (other columns are not identical.) I can build an array object with just the column I'm interested in but how can I make it a distinct list for a following loop?
You can use the union() function to get the unique list from the array.
Example:
I have a list of array values in a variable.
Using set variable activity, get the unique list from the array.
#union(variables('array_list'),variables('array_list'))
Output of set variable activity.

Parse ClassFormDefinition for a Custom Page Type Field's Values

I want to populate a dropdown in my webpart from a custom page type field's values.
so for e.g I have a custom pagetype my.pagetype which has a field called myfield and has value like 1,2,3. How Do I get these 1,2,3 values ?
How do I access through SQL or macro so far I have reached till here and this code is giving me a long XML Schema string which has all fields definition and values of the custom page type.
CMSContext.Current.GlobalObjects.Classes["my.pagetype"].ClassFormDefinition
How do I get around?
Are you populating the drop down list in that Page Type manually? (e.g. 1, 2, 3)
If you want to reuse the same list of value in multiple places, it's better for you to create a custom table to store those value (e.g. customtable_myListX). Then for the drop down list, you can use the SQL option (SELECT Value, Display FROM customtable_myListX).

Add own custom values on top of the ones returned by the template query

I'm using query options to define the values in my drop down which works quite well.
Besides the variables fetched by the query I'd like to add my own ones. Is that possible?
e.g. my dropdown would look like below
custom value 1
custom value 2
query value 1
query value 2
query value 3
etc.

Symfony2 - render an array collection within an entity as radio not as (dropdown) chioce field

I created a form with an collection of forms - the user shall be able to edit many items within one screen.
Each entity in the collection of forms consists for example of a text field and a choice field. The choice field contains some text options (of course).
I know that there is an option like here [ Default values for symfony2 choice radio box ] to define the possible values within the form type by giving an array.
But I do not want to iterate over my array collection within the form builder when I can avoid that. Because the collection is not just an array of strings but it is a collection of an entity (with a __toString() function so that I can get a textual representation for each of it).
Is there a way to render a radio field instead of the default dropdown choice field within the twig teamplate? Or by giving a special option to the form builder (without a loop)?
If you need to display a entity field using radios instead of select, you just have to set the expanded attribute to true:
$builder->add('post', 'entity', ['expanded' => true]);
If you also add the multiple attribute, you have a set of checkboxes instead.
Reference

Copy the Field value from one Form to other Form by #formula-LOTUS NOTES

I want to Copy the Field value from one Form to other Form by #formula, How can it do it.
Main Form name is "A", second Form name is "B",
Form "A" Field include[ID/Name/AEmail],Form "B"Field include[ID/DateTime/Record/BEamil]
When create a new record on Form B, then the Bemail Field value=AEmail when A.ID=B.ID.
First of all: You don't want to copy field values from one FORM to another, but from one DOCUMENT to another. It is important to understand the difference... A form defines, how to display Data, a document CONTAINS the data (and is displayed with the form that is named in the "Form"- item of the document.
But now to your question: If document A is selected, when you create document B, then you simply enable the FORM- Property "Formulas Inherit Values from selected document" on the second tab of the properties.
In the field- formulas of form B just enter the name of the Field in Form A as Formula.
e.G.: If the field in Form A is named "AEmail" then enter AEmail in the Value of field "BEmail" of Form B.
Beware: this "inheritance" is only done ONCE when the document is created, there will be no relation between the two documents to update BEmail, if AEmail changes. To update the values dependantly you would need to construct something like #GetDocField( unidOfDocA; "AEmail" ) but that would need some more knowledge of the formula language.