What´s the best way to work this and why does it gives me this error?

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

Parents Reply
  • 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.

Children
No Data