# Help with Data-shapes

**URL:** <https://forum.dynamobim.com/t/help-with-data-shapes/104581>\
**Category:** Packages\
**Tags:** dynamo, data-shapes\
**Created:** [September 23, 2024, 8:43pm UTC](https://forum.dynamobim.com/t/help-with-data-shapes/104581 "2024-09-23T20:43:14Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![gmayn](https://avatars.discourse-cdn.com/v4/letter/g/5e9695/32.png) [@gmayn](https://forum.dynamobim.com/u/gmayn)\
**Post date:** [September 23, 2024, 8:43pm UTC](https://forum.dynamobim.com/t/help-with-data-shapes/104581/1 "2024-09-23T20:43:14Z")

</div>

Hi all,

Looking for some help in adding a UI to a basic dynamo script I wrote that writes room parameter data to excel. I am hoping that the UI can help add additional functionality as well. It has been some time since I’ve used data-shapes (2018) and I am having trouble finding resources to get me to my goals below.

As currently written, the script writes 3 hard-coded parameters to an excel tab for a file at a fixed location. I am hoping to achieve the following with data-shapes UI tools.

-Select room parameters to be written to excel from the list of all room parameters  
-Have the ability to order selected parameters to be written in excel ie order of columns in excel  
-Select excel file via to write to via browser  
-Select excel tab to overwrite via selection (can’t remember if this is possible) or specify via form

Ideally the majority of the information could be specified from the initial UI pop-up.

Any help would be greatly appreciated. I was hoping there would have been more in terms of tutorials on YouTube so any resources would also be welcomed.

Thank you for your time,  
g

 ![Room Data to Excel](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/2/c22974be262857ce79092c2837716f88b85d8f57.png)

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [September 23, 2024, 8:54pm UTC](https://forum.dynamobim.com/t/help-with-data-shapes/104581/2 "2024-09-23T20:54:22Z")

</div>

Welcome!

Which Data-Shapes nodes have you tried so far? It sounds like you need a node to select multiple items in a list, a node to select a file in browser, and a node to select an item from a dropdown. Those all exist as base functionality within Data-Shapes.

Ordering your selection will likely require a little extra work but is fairly straightforward. After the first selection of parameters to query, create a dropdown for each one to represent the columns in Excel. The parameter selected in each dropdown would then be the parameter to assign to each column.

---

<div class="post-metadata">

**Author:** ![gmayn](https://avatars.discourse-cdn.com/v4/letter/g/5e9695/32.png) [@gmayn](https://forum.dynamobim.com/u/gmayn)\
**Post date:** [September 23, 2024, 9:04pm UTC](https://forum.dynamobim.com/t/help-with-data-shapes/104581/3 "2024-09-23T21:04:06Z")

</div>

Hi Nick,

Thanks for the welcome. I had tried a DropDown Data but I seem to be querying all parameters of all rooms. I know I crossed some wire here and the Listview Data might be more appropriate.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/b/4b9c23466ee8daf2da52bc42bb3e9c73eea4c4e8.png)

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [September 23, 2024, 9:27pm UTC](https://forum.dynamobim.com/t/help-with-data-shapes/104581/4 "2024-09-23T21:27:56Z")

</div>

> [@gmayn](#):
>
> I seem to be querying all parameters of all rooms

Yup. You’re getting all rooms, then all parameters from all rooms, then creating a dropdown with all those values. That’s not going to work. You just need all the parameters associated with rooms. You can do this by just using the parameters from _one_ room.

> [@gmayn](#):
>
> Listview Data might be more appropriate

Correct. `List.View` will allow you to select multiple parameters from all those provided. Then you will use the selected parameters to create dropdowns to choose order, but that’s step two.

---

<div class="post-metadata">

**Author:** ![gmayn](https://avatars.discourse-cdn.com/v4/letter/g/5e9695/32.png) [@gmayn](https://forum.dynamobim.com/u/gmayn)\
**Post date:** [September 26, 2024, 4:00am UTC](https://forum.dynamobim.com/t/help-with-data-shapes/104581/5 "2024-09-26T04:00:59Z")

</div>

Thanks for the direction! I’ve solved the first part and am now able to get a list of selected parameters from a given element.

 ![Edu. Spec to Excel UI_2024-09-25_11-32-20](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/9/f9b5a6f0016b9823ac6b899e445380a5ec7b76ca.png)

Now I’m a little unsure about what the next steps should be order of operations wise, but here’s my guess.  
-Figure out how to get element parameter values for _all_ elements of initially selected type (in this case rooms)  
-Split data (initially selected parameters) for _all_ elements into individual lists  
-Specify column per list for excel writing

Also, is my initial goal of having the user specify all information from a single data shapes prompt possible? Given the steps outlined above must the user first select parameters, run script, then be met with another prompt to specify excel columns?

Any help regarding next steps and ui navigation would be greatly appreciated.

Thanks

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [September 26, 2024, 1:38pm UTC](https://forum.dynamobim.com/t/help-with-data-shapes/104581/6 "2024-09-26T13:38:05Z")

</div>

Your graph is illegible so I can’t tell exactly what you’re doing but it sounds like you have the right idea. You can do all of this in one script, but it will take two input prompts: the first to select the parameters to include and the second to order them. You’ll likely want to do all of this through a single list structure, otherwise it wouldn’t be dynamic (you’d have to know how many parameters are being selected to know how many lists to deal with) - this is best practice anyway.

1. Use Data-Shapes to select the required parameters from a list. This gives us a variable, but known, number of parameters to deal with, _n_.
2. Create a dropdown input with Data-Shapes for each parameter selected. We can do this by duplicating the dropdown input _n_ number of times and labeling them 1-_n_.
3. Prompt for the second input (parameter/column order) with each list of dropdown options being the list of selected parameters. The label represents the column placement and the parameter determines which parameter will go in that column: Dropdown 1 will be the first column, Dropdown 2 will be the second column, etc.
4. Use the list of ordered dropdown values to get the matching parameter values from your list of elements using the appropriate list levels.
5. Transpose the data (to match Excel formatting) and export.

---

<div class="post-metadata">

**Author:** ![gmayn](https://avatars.discourse-cdn.com/v4/letter/g/5e9695/32.png) [@gmayn](https://forum.dynamobim.com/u/gmayn)\
**Post date:** [September 26, 2024, 3:24pm UTC](https://forum.dynamobim.com/t/help-with-data-shapes/104581/7 "2024-09-26T15:24:37Z")

</div>

Thank you for taking a look. Apologies for the illegible graph, not sure what the issue is there. I am able to download and view clearly. Will try the steps you mentioned, thanks again

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [September 26, 2024, 3:36pm UTC](https://forum.dynamobim.com/t/help-with-data-shapes/104581/8 "2024-09-26T15:36:16Z")

</div>

The node titles aren’t visible. This happens when you’re zoomed out too far. Always use the Export as Image button in Dynamo when taking screenshots and always make sure the node titles are visible. The export will include the full graph, not just what’s visible on screen so you don’t need to worry about cropping.

---

<div class="post-metadata">

**Author:** ![gmayn](https://avatars.discourse-cdn.com/v4/letter/g/5e9695/32.png) [@gmayn](https://forum.dynamobim.com/u/gmayn)\
**Post date:** [September 26, 2024, 8:10pm UTC](https://forum.dynamobim.com/t/help-with-data-shapes/104581/9 "2024-09-26T20:10:03Z")

</div>

Understood, my apologies. See larger export below.

 ![Edu. Spec to Excel UI_2024-09-26_01-30-33](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/c/8c1219bb168673d614dfdc25ca4ebfbe69139891.png)

---

<div class="post-metadata">

**Author:** ![gmayn](https://avatars.discourse-cdn.com/v4/letter/g/5e9695/32.png) [@gmayn](https://forum.dynamobim.com/u/gmayn)\
**Post date:** [October 1, 2024, 3:44am UTC](https://forum.dynamobim.com/t/help-with-data-shapes/104581/10 "2024-10-01T03:44:51Z")

</div>

Thanks for the direction and sorry for the delay. I’ve tried to incorporate your feedback but despite being met with what appear to be correct UI prompts, the DropDown user input doesn’t seem to reflect my selection once the script is run. Any advice?

Please see screenshot and full script below.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/c/fc29f7ccdf9b2cb1add1cf90d9d30babdd02c1c6.jpeg)  
 ![Edu. Spec to Excel UI_2024-09-30_11-39-01](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/2/62732719fefaf8e7e3ae6a2140c698527d32ad47.png)

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [October 1, 2024, 1:35pm UTC](https://forum.dynamobim.com/t/help-with-data-shapes/104581/11 "2024-10-01T13:35:23Z")

</div>

None of your inputs match in structure which is going to make things really confusing. You either need to use flattened lists with the correct list levels or the exact number/structure of inputs. Remember, a single dropdown will have multiple options to choose from which means multiple key, value pairs.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/d/6d66ffc13e5b1174052075ce2c770f90ee9aebef.jpeg)

Your key, value pairs are also unrelated, so the outputs do actually match what you have defined - they’re just wrong. The key selected will return the corresponding value.

Right now you have a dropdown for each parameter and you’re selecting the column. You can do it this way but it requires extra work in rearranging the parameters and the columns to then be in the correct order. My suggestion was to have a dropdown for each column and select the parameter. That way you don’t have to rearrange anything. The output will be the list of parameters _in order_, so you can just get the values directly from the parameter list and they’ll already be in the correct order.

 ![parameterselection](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/b/4bd8eb58f1319e16c36fc47ee998d16859121c36.png)
