Issues with a!PickerFieldUsers() function

Certified Associate Developer

Hello,

I have a requirement to build up a dynamic form based on the CDT we receive from API call. On the basis of keyAttribute value we are displaying the various controls. Now what i'm doing is I'm displaying the controls and their default values from the CDT received and saving the values to another CDT. Every other controls are working fine but with a!pickerFieldUser() funciton i'm getting errors. Below is the code I'm using

 

load(
local!tempUservalue:if(or(isnull(ri!defDataContentMetrics_cdt[ri!index].FormAttributeValue),
len(ri!defDataContentMetrics_cdt[ri!index].FormAttributeValue)=0),
null,
ri!defDataContentMetrics_cdt[ri!index].FormAttributeValue
),

with(
a!pickerFieldUsers(
label:ri!defDataContentMetrics_cdt[ri!index].ContentMetric,
lablePosition: "ABOVE",
maxSelections: 1,
value: local!tempUserValue,
saveInto: {
local!tempUserValue,
a!save(
ri!defDataContentMetrics_cdt[ri!index].FormAttributeValue,
if(
or(
isnull(save!value),
len(save!value) = 0
),
null,
save!value
)
),

 

a!save(
ri!ContentMetricsUpdatedValue_cdt[ri!index].FormAttributeValue,
if(
or(
isnull(save!value),
len(save!value) = 0
),
null,
save!value 
)
)
},
required: if(ri!defDataContentMetrics_cdt[ri!index].Required=1,true,false)
)

)
),

 

Where defDataContentMetrics_cdt is fetching values from API Call and ContentMetricsUpdatedValue_cdt is used to store the values. Can somebody tell me what is wrong inside the code?

  Discussion posts and replies are publicly visible

Parents Reply
  • I am not sure why that is happening there. Is it a user name that has been selected in another instance of this rule? Perhaps the indexes are confused mixed up somehow? Have you tried adding a textfield to this expression to debug the incoming value of local!tempUserValue?

    Also - you do not need the with() wrapped around the pickerField unless you intend to declare a local variable to be used in the pickerField. I doubt this is causing your issue, but it is not necessary.
Children