{"action":"created","issue":{"url":"https://api.github.com/repos/aldeed/meteor-autoform/issues/622","labels_url":"https://api.github.com/repos/aldeed/meteor-autoform/issues/622/labels{/name}","comments_url":"https://api.github.com/repos/aldeed/meteor-autoform/issues/622/comments","events_url":"https://api.github.com/repos/aldeed/meteor-autoform/issues/622/events","html_url":"https://github.com/aldeed/meteor-autoform/issues/622","id":54056729,"number":622,"title":"[Question] AutoForm.getFieldValue for array fields","user":{"login":"msamoylov","id":106813,"avatar_url":"https://avatars.githubusercontent.com/u/106813?v=3","gravatar_id":"","url":"https://api.github.com/users/msamoylov","html_url":"https://github.com/msamoylov","followers_url":"https://api.github.com/users/msamoylov/followers","following_url":"https://api.github.com/users/msamoylov/following{/other_user}","gists_url":"https://api.github.com/users/msamoylov/gists{/gist_id}","starred_url":"https://api.github.com/users/msamoylov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/msamoylov/subscriptions","organizations_url":"https://api.github.com/users/msamoylov/orgs","repos_url":"https://api.github.com/users/msamoylov/repos","events_url":"https://api.github.com/users/msamoylov/events{/privacy}","received_events_url":"https://api.github.com/users/msamoylov/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/aldeed/meteor-autoform/labels/confirmed%20bug","name":"confirmed bug","color":"e11d21"},{"url":"https://api.github.com/repos/aldeed/meteor-autoform/labels/done%20in%20development%20branch","name":"done in development branch","color":"fef2c0"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/aldeed/meteor-autoform/milestones/2","html_url":"https://github.com/aldeed/meteor-autoform/milestones/5.0.0","labels_url":"https://api.github.com/repos/aldeed/meteor-autoform/milestones/2/labels","id":985693,"number":2,"title":"5.0.0","description":"","creator":{"login":"aldeed","id":3012067,"avatar_url":"https://avatars.githubusercontent.com/u/3012067?v=3","gravatar_id":"","url":"https://api.github.com/users/aldeed","html_url":"https://github.com/aldeed","followers_url":"https://api.github.com/users/aldeed/followers","following_url":"https://api.github.com/users/aldeed/following{/other_user}","gists_url":"https://api.github.com/users/aldeed/gists{/gist_id}","starred_url":"https://api.github.com/users/aldeed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aldeed/subscriptions","organizations_url":"https://api.github.com/users/aldeed/orgs","repos_url":"https://api.github.com/users/aldeed/repos","events_url":"https://api.github.com/users/aldeed/events{/privacy}","received_events_url":"https://api.github.com/users/aldeed/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":39,"state":"open","created_at":"2015-02-19T04:03:10Z","updated_at":"2015-03-08T21:28:20Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2015-01-12T14:04:26Z","updated_at":"2015-03-17T14:38:16Z","closed_at":"2015-03-08T21:16:44Z","body":"CC'ing from http://stackoverflow.com/questions/27903737/autoform-getfieldvalue-for-array-fields\r\n\r\nI have a schema declared as:\r\n\r\n    JobSchema = new SimpleSchema({\r\n        responsibilities: {\r\n            type: [String],\r\n            optional: true\r\n        },\r\n        'responsibilities.$': {\r\n            min: 2,\r\n            autoform: {\r\n                afFieldInput: {\r\n                    class: 'form-control'\r\n                },\r\n                placeholder: 'E.g. \"Build tools according to specifications\"'\r\n            }\r\n        }\r\n    });\r\n\r\nAlso I have an UI helper declared as:\r\n\r\n    Template.registerHelper('currentFieldValue', function (fieldName) {\r\n        return AutoForm.getFieldValue('insertJobForm', fieldName) || '';\r\n    });\r\n\r\nI have a template where I used this helper to generate a form preview. It works like charm for all fields except the array ones. Nothing is being rendered. Any ideas?\r\n\r\n    {{# if currentFieldValue \"responsibilities\"}}\r\n        <h3>Responsibilities</h3>\r\n        {{{currentFieldValue \"responsibilities\"}}}\r\n    {{/if}}"},"comment":{"url":"https://api.github.com/repos/aldeed/meteor-autoform/issues/comments/82387634","html_url":"https://github.com/aldeed/meteor-autoform/issues/622#issuecomment-82387634","issue_url":"https://api.github.com/repos/aldeed/meteor-autoform/issues/622","id":82387634,"user":{"login":"dukye","id":340965,"avatar_url":"https://avatars.githubusercontent.com/u/340965?v=3","gravatar_id":"","url":"https://api.github.com/users/dukye","html_url":"https://github.com/dukye","followers_url":"https://api.github.com/users/dukye/followers","following_url":"https://api.github.com/users/dukye/following{/other_user}","gists_url":"https://api.github.com/users/dukye/gists{/gist_id}","starred_url":"https://api.github.com/users/dukye/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dukye/subscriptions","organizations_url":"https://api.github.com/users/dukye/orgs","repos_url":"https://api.github.com/users/dukye/repos","events_url":"https://api.github.com/users/dukye/events{/privacy}","received_events_url":"https://api.github.com/users/dukye/received_events","type":"User","site_admin":false},"created_at":"2015-03-17T14:38:16Z","updated_at":"2015-03-17T14:38:16Z","body":"Hello,\r\n\r\nFound this issue when i was searching function tips for firstOption properties.\r\n\r\nI have tried to apply those changes related to commit (9 days) following this comment : \r\n\"**Compatibility break:** The function signature for `AutoForm.getFieldValue` is reversed from `(formId, fieldName)` to `(fieldName, [formId])` with `formId` optional. You should not pass the `formId` argument when using it in a helper that is run within the context of the form.\"\r\n\r\nSo i put in my own code : \r\nCase 1 : val = AutoForm.getFieldValue(fieldName, formId); // NOT WORKING reactivity problem\r\nCase 2 : val = AutoForm.getFieldValue(fieldName); // WORKING :)\r\n\r\nIs that normal ?\r\n\r\nThx Eric\r\nduke"}}