Getting only first value of list collector in an array

Shweta Maurya
Tera Contributor

Requirement-->In  catalog task "affected ci" field need to set same as catalog variables for every task and in every task the ci is different because the number of catalog task is trigger based on number of asset selected in "catalog variables".

issue->I have written script in flow designer to set affected ci... but it is always setting first asset name in affected ci in all task.

5 REPLIES 5

JenniferRah
Mega Sage

Could you maybe share your script? It's hard to determine the issue just with this information.

Shweta Maurya
Tera Contributor

1000080964 (1).jpgAs i cannot copy the script as i am working on VM so attached the script image.

 

 

Can you please try updating the line 'arr.push(splitArray[j])' to 'arr.push(splitArray[j].toString())' and see if that works?

Also I could not understand why you are pushing the elements from 'splitArray' to a new array ('arr') whereas splitArray itself is an array. You could directly use 'splitArray' instead of creating a new one with the same array elements.

 

If this address your question, please mark this response correct by clicking on Accept as Solution and/or Kudos.

You may mark this helpful as well if it helps you.

Thanks, 

Animesh Das

Animesh Das2
Mega Sage

Hi @Shweta Maurya,

 

I agree with @JenniferRah that if you share the script along with flow designer step/s would help us to get more information.

 

However, it seems you are doing a common mistake that while pushing the values to the array you are not converting the values to string before.

For example, below code snippets are one of the two ways to push values into an array converting into string before,

1. array.push(gr.getValue("field_name")); --> in case of field value extracted from glide record
2. array.push(field_value.toString());

Please verify this once in your code.

 

If this address your question, please mark this response correct by clicking on Accept as Solution and/or Kudos.

You may mark this helpful as well if it helps you.

Thanks, 

Animesh Das