Create multiple select boxes dynamically by passing list as input

Hello,

Scenario:

Input will be excel file. Get All sheets will give all the sheets in collection (count and name of sheets will be unknown every time)

Now, I want to display check boxes with sheet names as their labels, depending on how many sheet names are saved in the collection at run time.

I tried to create form with the help of tutorial given on documentation page but it doesn’t work and article seems to be missing many steps there.

Please guide on this. TIA

Hi @shubhamkumar.tiwari

While there can be multiple ways a shortcut way comes to my mind.
What you can do is use a for each sheet activity and append the currentSheet to a list variable or string array and use it later on.

My question is about creating check boxes in form by sheetnames and count. Sorry couldn’t get you.

Can you provide an example output?

@shubhamkumar.tiwari
You gen get the list of sheet names by doing this

Do you want the checkbox in form then once you got the output from work flow 1 then pass this list

@shubhamkumar.tiwari I hope its work for you.

Thanks for your effort Mukesh but I tried to follow this documentation already. Not able to achieve the checkboxes.

After executing only 1 checkbox appears on my form even when I have give 5 items in input choiceList

Pass this value in string Arrayp

For Each Sheet and add the sheet name to a datatable. Then add a boolean column to the datatable. Pass this datatable to the form. Then when you display it as an edit grid on the form it’ll have the checkboxes for the boolean column.

This might work. Let me give it a try.

Can you tell if there is a limit on generating number of check boxes in form ? or may be number of rows for your solution?
In my input excel there can be 50+ sheets. So are 50+ checkboxes possible?

Yes. It’s an edit grid, it’s designed for it.

Hello,

I was able to get 2 columns with Sheet names and Check boxes respectively using Data grid not Edit grid. Don’t need those edit & save options but only checkboxes.

But check boxes are being displayed as non editable. They cannot be checked or unchecked. What am I missing here?

That’s why you use Edit Grid, because it makes the values (a checkbox is a true/false value) editable.

Nope, with Edit grid also it is getting displayed as non editable only. I tried.
Can you point if I am missing something? or if you can send a Xaml please?

Have you looked in the properties of the edit grid? There is probably a setting you have to change to make it editable.

Here is solution,

Select FormFieldsCollection from properties panel.
Create
argument 1 with any name(selectBoxes) with suffix as “_dropdown”, Direction = In, Type = List(String)
argument 2 with above name (selectBoxes)( remove the suffix here), Dir = Out, Type = Dict(String,Boolean)

“selectBoxes” or yourArgumentName should be the fieldKey of Select box component in form designer to map it with the arguments.

This will dynamically create checkboxes based on number of items present in the input list. In my case its number of sheet names in input list.

Appreciate everyone’s help.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.