Discussion posts and replies are publicly visible
use touniformstring() Function for this.
in the button?
Use the null check condition in your Ex rule and with the help of touniformstring() Converts a value to Text.you can share your Code for better understanding.
what I find weird is that the value that I want to pass is an integer :buttons: a!buttonLayout( primaryButtons: { a!buttonWidget( label: "Criar", saveInto: { a!save( target: ri!record.idLocation, value: local!selectedLocation ), if( a!isNullOrEmpty(local!Skill), {}, a!forEach( items:local!Skill, expression:a!save( ri!recordCandidateSkills[fv!index], fv!item.idSkill ) ) ),
I'm guessing the issue you're facing is in your a!forEach() statement at the bottom here. When you reference ri!recordCandidateSkills[fv!index], Appian can be finnicky about addressing an index in an array that does not [yet] exist. What you should do instead is think of this in terms of assembling the entire array you want ri!recordCandidateSkills to contain, and saving the whole assembled thing all at once. I'll attempt to freehand what i'd suggest you re-write it as, though this might need further refining:
a!save( ri!recordCandidateSkills, if( /* note, this is somewhat unnecessary as a!forEach returns an empty set in this case anyway */ a!isNullOrEmpty(local!skill), {}, a!forEach( local!skill, fv!item.idSkill ) ) )
thank you. But now it gets almost the same error but saying that it cannot index from text to number...
a!save( ri!recordCandidateSkills, if( a!isNullOrEmpty(local!Skill), {}, a!forEach(local!skill, fv!item.idSkill) ) ),
That means your local!skill variable does not contain a property named "idSkill" (at least at one particular iteration of a!forEach()), yet you're trying to reference the property by dot-notation anyway.
The "real" solution for this would of course be to ensure that your "local!skill" variable is clean, i.e. ensuring it always contains that property (unless it's null/empty), but as a quick workaround, you can replace fv!item.idSkill with property(fv!item, "idSkill", null()), which will attempt to access the "idSkill" property from the current iteration, and if none is found, return null instead.
Yes, the "local!skill" is empty. Property function worked well, thaaaank you very much !