JSON Field Expressions in v3 #6184
-
In v2, we had the ability to specify JSON for the field type and in v3 this is no longer present. v3 shows has options for field expressions listed below but none for JSON: No matter what variation I try:
I get a similar error regarding deserialization no matter what I try: Failed to deserialize ["00.Comms","01.Sales"] to Newtonsoft.Json.Linq.JArray Here is how the field is defined in my activity: [Input(
DisplayName = "Sales Folder Names",
UIHint = InputUIHints.JsonEditor
)]
public Input<JArray?> SalesFolderNames { get; set; } = default!; Even better if I could specify a strongly-typed model object directly for the field instead of a |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Elsa variables, inputs and outputs are generally ExpandoObjects behind the scenes, so instead of passing in the array as stringified, which results in a string, you might want to try to pass in your list as
If getting a JArray is important, you could pass it as JSON.stringify() and then use Not sure if I understood the problem correctly, hope this helps. |
Beta Was this translation helpful? Give feedback.
Elsa variables, inputs and outputs are generally ExpandoObjects behind the scenes, so instead of passing in the array as stringified, which results in a string, you might want to try to pass in your list as
return ["00.Comms", "01.Sales"];
and use
public Input<List<string>> SalesFolderNames { get; set; } = default!;
as your input in your activity.
if you wish to pass in more complex objects, which you have a model for, you can define the input as
public Input<object> SalesFolderNames { get; set; } = default!;
or
public Input<List<object>> SalesFolderNames { get; set; } = default!;
you can then do something like