Hello, I'm not quite sure if I'm working with this pickerFieldRecord correctly (it is not saving any value in the rule input) and I don't understand why it says that "idSkill" is type Text because it isn't...
a!localVariables( local!Skill, (...) a!pickerFieldRecords( label: "Competências", labelPosition: "ABOVE", placeholder: "-- selecione uma ou mais competências --", maxSelections: 3, recordType: 'recordType!{b10f5f28-725c-4c8b-a211-776386be5222}RM_ref_Skill', value: ri!recordCandidateSkills.idSkill, saveInto: {local!Skill, a!save( ri!recordCandidateSkills.idSkill, if( a!isNullOrEmpty(local!Skill), {}, a!forEach( local!Skill.idSkill, property(fv!item, "idSkill", null()) ) ) )},
Discussion posts and replies are publicly visible
The issue is with your local!Skill. The picker field will store just the ID of the selected record to local!Skill wich makes this a list of integer. Then in line 27 you try to do something by indexing into this local.
I was trying to save the id of the selected skills in a local and then, in the forEach, save them in the rule inputs "idSkill".
local!skill does NOT have a property called "idSkill", but you're trying to directly refer to such a property anyway. Needless to say, that won't work.
yea I don't understand why..(But I found another way)
don't understand why what?
Your "local!skill" local variable is a simple array of ID (integer).
But in your a!forEach call, you're trying to iterate over a (nonexistent) "idSkill" property (this is the source of the error message in your screenshot as far as I can tell). That is, "local!Skill.idSkill" does not exist, but you're calling it using the dot property operator.
Then, inside your forEach loop, you're trying to reference yet another property of fv!item (despite the fact that even if local!skill DID have the "idSkill" property, fv!item would already just be the simple integer, and would not have its own "idSkill" sub-property). This wouldn't cause the error in question, but the result of this would only ever be null.
If you're structuring this properly, you'd assemble a brand new array of "ri!recordCandidateSkills" every time you add a new entry (here we're assuming all the other properties of the array can be blank for now).
{ local!Skill, a!save( ri!recordCandidateSkills, a!forEach( local!Skill, { idSkill: fv!item } ) ) }