Defining and array field?
See original GitHub issueI am trying to define a fairly complex nested field set. Below is an example.
How do I define an array in the field definition?
const fields = [{
name: 'someField',
label: 'Some Field',
rules: 'required|string'
}, {
name: 'clients', // This need to be an array of clients.
label: 'Clients',
fields: [{
name: 'title',
label: 'Title',
rules: 'required|string'
}, {
name: 'firstname',
label: 'Firstname',
rules: 'required|string'
}, {
name: 'surname',
label: 'Surname',
rules: 'required|string'
}],
}];
example JSON:
{
someField: 'value',
clients: [{
title: 'Mr',
firstname: 'John',
surname: 'Smith',
}, {
title: 'Mrs',
firstname: 'Susan',
surname: 'Smith',
}],
}
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Arrays in C++
An array is a collection of elements of the same type placed in contiguous memory locations that can be individually referenced by using...
Read more >Arrays - Software AG Documentation
Defining Arrays. In Natural, an array can be one-, two- or three-dimensional. It can be an independent variable, part of a larger data...
Read more >Defining Arrays - TechDocs - Broadcom Inc.
An array is a structure that stores sets of data within a function. The contents of an array are available only as long...
Read more >Arrays in Java - GeeksforGeeks
An array can contain primitives (int, char, etc.) and object (or non-primitive) references of a class depending on the definition of the array....
Read more >Define Array Fields in the UI | Adobe Experience Platform
When defining an Experience Data Model (XDM) field in the Adobe Experience Platform user interface, you can designate that field as an array....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Even it’s not straight-forward, is there a way to use Unified Properties to define an ‘array’ field? I’d like to use unified properties as i can keep all the info regarding one field in one place.
@foxhound87 is it possible? (regarding question above)