LightningFlowComponents icon indicating copy to clipboard operation
LightningFlowComponents copied to clipboard

Can't get Dual List Box working when there are spaces in the options

Open leftpropeller opened this issue 2 years ago • 19 comments

When I provide options in a csv string: One 1,Two 2,Three 3 it's somewhere between erratic and non-functioning. However when I remove the spaces, making it One1,Two2,Three3, it works beautifully.

What can I do to pass it a csv string that includes spaces?

leftpropeller avatar Oct 29 '21 18:10 leftpropeller

When I provide options in a csv string: One 1,Two 2,Three 3 it's somewhere between erratic and non-functioning. However when I remove the spaces, making it One1,Two2,Three3, it works beautifully.

What can I do to pass it a csv string that includes spaces?

I've noticed the same behavior. I thought perhaps using two collection strings to provide a list of labels with spaces and a list of values without might be a workaround, but doing so causes an error even before I try to reference the selected values.

"The Lightning Component c:fsc_dualListBox2 generated invalid output for field selectedOptionsFieldDescriptorList. Contact your administrator with these details: Flow encountered an error when processing and converting between data types. Please check the flow and ensure all data types are matched correctly."

teepeepdx avatar Nov 04 '21 23:11 teepeepdx

I am bumbing into the same issue.

On my end it doesn't work even without spaces: image

Versions: FlowActionsBasePack=2.33 FlowScreenComponentsBasePack=2.5.9 Flow-Version=53

The Error only shows up with Two String Collections. It does not show in One String Collection.

The Two String Collections are of the same length: image

ChrisLHI avatar Nov 11 '21 12:11 ChrisLHI

@adwhite75 @alexed1 There are some strange things happening with this component. Are either of you able to figure out what's going on?

  1. When using a CSV string, the first space in the string is removed (see line 147 in extendedBaseDualListBox.js) [ items.replace(/[\s]+/g, '') would replace all spaces but I'm not sure why that would even be necessary ]
  2. Two String Collections will always cause the error @ChrisLHI mentions above. I can't find where in the code it is happening because the component makes it all the way through the validation method.

I've also created PR#968 with a new Test Flow for this component.

ericrsmith35 avatar Nov 13 '21 19:11 ericrsmith35

@leftpropeller @teepeepdx @ChrisLHI For now, make sure you have the current version of the FlowScreenComponentsBasePack installed and use a single string collection.

ericrsmith35 avatar Nov 13 '21 19:11 ericrsmith35

If someone can make a set of bug reports with reproducible steps and actual vs. expected results, I can see if I can get someone to look at this.

alexed1 avatar Nov 13 '21 23:11 alexed1

Same issue here :(

Did anyone manage to find a solution to this?

Swiftnesses avatar Dec 13 '21 20:12 Swiftnesses

I tried the Two String Collections but if I select any items and try to go "next", I get the same error noted above "The Lightning Component c:fsc_dualListBox2 generated invalid output for field selectedOptionsFieldDescriptorList. Contact your administrator with these details: Flow encountered an error when processing and converting between data types. Please check the flow and ensure all data types are matched correctly." I am trying to use this to select records, not picklist values so I need to use the name and ID (two string collections). I just downloaded the latest version of these packages last week.

choughSFDC avatar Feb 07 '22 17:02 choughSFDC

I am facing the same issue as you @choughSFDC

mitul0520 avatar Apr 12 '22 22:04 mitul0520

@mitul0520 The only way I could get this to work was with the One String Collection method. It is not ideal for me since I have a name and an ID for each item, but I can map them outside of this control since my names are unique.

choughSFDC avatar Apr 13 '22 13:04 choughSFDC

Workaround On the first item in the list, place a space after the first letter of the word. This will solve the issue of taking away the first space.

i.e (Account Name) turns in AccountName with the bug.

Solution: (A ccount Name) turns in Account Name with the bug.

@alexed1 @adwhite75

BNKHD avatar Jun 16 '22 17:06 BNKHD

I'm having the same issue as @choughSFDC and @mitul0520. I am trying to use a name/ID value pair as a selection so I can then work with records after wards and I'm encountering the issue even with the most recent version.

Error: The Lightning Component c:fsc_dualListBox3 generated invalid output for field selectedOptionsFieldDescriptorList. Contact your administrator with these details: Flow encountered an error when processing and converting between data types. Please check the flow and ensure all data types are matched correctly.

etschrad-brookfield avatar Dec 16 '22 18:12 etschrad-brookfield

Does this error go away the next day? I've seen intermittent errors like this with other components.

ericrsmith35 avatar Dec 16 '22 21:12 ericrsmith35

Not for me - I encountered it yesterday and it's still there today. I've cleared cookies and tried in incognito with and without cookies allowed - same error.

etschrad-brookfield avatar Dec 16 '22 21:12 etschrad-brookfield

I am facing the same problem using Two String Collections to pair Name/Id. "Lightning Component c:fsc_dualListBox3 generated invalid output for field selectedOptionsFieldDescriptorList". Is it still not fixed? Is there any workaround?

AdrianaOliveira28 avatar Jul 07 '23 10:07 AdrianaOliveira28

As far as I know it is not fixed. I had to make my own duallistbox LWC for my Flow.

etschrad-brookfield avatar Jul 07 '23 14:07 etschrad-brookfield

I've been able to work around this, though the solution isn't great.

Changing the Javascript method selectedOptionsFieldDescriptorList in fsc_dualListBox3.js to return null; instead of the actual return value allows the Dual List Box to fully function.

Now this likely breaks the ability to use the FieldDescriptor option of working with Dual List Boxes, but since I'm only working with CSV values it works just fine for me.

Now, I just have to figure out how to deploy it directly to Production....as you can't use a changeset! I was going to say I was able to do this fine with SFDX, but it was to a dev org. I think we still can, but it will be tricky.

adamerstelle avatar Sep 03 '23 04:09 adamerstelle

I was getting the same error with Dual List v3 for the two string collection option. The label is User names, so spaces were involved, and the Value is their emails. I was able to solve it declaratively by manually assigning the output variable for the string.

Screenshot 2024-02-02 100047

huyghet avatar Feb 02 '24 18:02 huyghet

I wanted to come back to this because it's been a few years and I don't like having to use my own LWC. In case it helps anyone get to the needed solution, here is what I've found so far, above and beyond that the "get" function for selectedOptionsFieldDescriptorList is being called when it shouldn't - when one is using Two String lists.

I believe Line 127 in fsc_dualListBox3.js is the problem (or part of it). It's returning "true" for the Two String option. The Two String option shouldn't be trying to return or populate a list of field descriptors, right? Just to be thorough - line 130 also returns true, which leads to the Two String selection having both of those functions try to set the selected values.

Another note: even trying to grab the "selectedOptionsFieldDescriptorList" output when using the FieldDescription selection fails.

I'll continue to work on this, but just wanted to provide an update on what I've found.

image

etschrad-brookfield avatar Feb 28 '24 19:02 etschrad-brookfield