โ02-27-2025 12:49 AM
Is there a formula that can be used to convert list of String variables to a list of integers ?
I/P is ["1","100","50", "4"]
O/P [1,100,50,4]
Solved! Go to Solution.
โ03-02-2025 06:09 AM
Hi @shefali,
If you observe my screenshots:
1๏ธโฃ In the 2nd and 3rd images,
I used Variable_name: List and Datatype: String. When applying the pluck("v") formula, it automatically converts to List_of_Numbers, so there's no need to explicitly set the data type as List.
2๏ธโฃ I have a small curiosity: Why do we need to create two variables with Integer or Number data types to parse a number list?
Answer: There's no need to use two variables. As I suggested, when we apply the pluck("v") formula, it automatically takes care of converting to List_of_Numbers.
3๏ธโฃ However, when using list functions, it still treats the variable as a list. Shouldn't it actually be recognized as a number instead?
Could you please share a screenshot? I didnโt fully understand your point here.
Looking forward to your insights! ๐
Thanks and Regards,
Shivakumar K A
โ03-02-2025 07:18 AM - edited โ03-02-2025 10:40 PM
Hi @shefali ,
We should be able to apply the min or max formula directly after using pluck("v"), but since our formulas are applied to the input rather than the output, applying Max or Min will be on the "List_of_String" not on the List_of_Integer. I hope it is clear for you
Thanks and Regards,
Shivakumara K A
2 weeks ago
This works especially well if you use the Parse JSON from the JSON Tools by Workato. You simply put in, [0] as the sample document, then that formula as the input document! Thank you all.