2 weeks ago
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.
a week ago
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
a week ago
Hi @shefali,
Can you check this schema
[
{
"control_type": "text",
"label": "list_num",
"parse_output": "integer_conversion",
"name": "list_num",
"type": "integer",
"of": "integer",
"optional": true,
"details": {
"real_name": "list_num"
},
"initially_expanded": true,
"hint": "Defaults to nil if not supplied.",
"sticky": true
}
]
Regards,
Prudvi
a week ago
Hi Prudvi,
I tried updating my int variable schema exactly like yours. Still, the auto-conversion from List String to List Num is not working. Here is my update schema for reference " -
[
{
"control_type": "text",
"label": "v_tempInt",
"parse_output": "integer_conversion",
"name": "v_tempInt",
"type": "integer",
"of": "integer",
"optional": true,
"details": {
"real_name": "v_tempInt"
},
"initially_expanded": true,
"hint": "Defaults to nil if not supplied.",
"sticky": true
}
]
a week ago - last edited a week ago
Hi @shefali,
This is the schema of previous step variable
[
{
"name": "list_str",
"type": "array",
"of": "string",
"label": "list_str",
"optional": true,
"details": {
"real_name": "num"
},
"initially_expanded": true,
"hint": "Defaults to nil if not supplied.",
"sticky": true
}
]
Regards,
Prudvi
a week ago
Hi Prudvi,
I tried updating the source List String schema as yours. Still no luck. Here is a snippet schema code. Please let me know if you guys need any more info from me to debug this issue.
[
{
"label": "v_StringTemp",
"name": "v_StringTemp",
"type": "array",
"of": "string",
"optional": true,
"details": {
"real_name": "v_StringTemp"
},
"initially_expanded": true,
"hint": "Defaults to nil if not supplied.",
"sticky": true
}
]
a week ago
Hi @shefali,
is it possible to share the JSON which you are passing to the variable.
Regards,
Prudvi