Delayed loop with table
I'm having an issue where I'm trying to concatenate one of the columns of a table in a hidden control field but the update is lagging behind. It only updates the concatenated string when i add a new row to the table. I want it to update as soon as the row changes.
The code for the rule is below.
var event = BuildingIEP.value.length;
var IEP_index_start = forwardIEPRepeat.itemAdded ? forwardIEPRepeat.itemIndex: 0;
var IEP_index_end = forwardIEPRepeat.itemAdded ? IEP_index_start + 1 : BuildingIEP.value.length;
var array1 = [];
var text = "";
for (let i = IEP_index_start; i < IEP_index_end; i++){
array1 = SpeSerCoord.value;
text = array1.join();
EmailsIEP.value=text;
}
-
Official comment
Hi Josh,
Thank for your query.
Could you try the below script and see if it works,
var array1 = [];
var text = SpeSerCoord[0].value;
for (var i=1; i<BuildingIEP.value.length; i++){
if(SpeSerCoord[i].value.length > 0){
text = text + ',' + SpeSerCoord[i].value;
}
}
EmailsIEP.value=text;
var event1 = forwardIEPRepeat.itemAdded;
var event2 = forwardIEPRepeat.itemRemoved;Please let us know if this works.
Thanks,
Radhika
Please sign in to leave a comment.
Comments
1 comment