Forum Discussion
Extracting data from multiple XML files
- 9 years ago
Hi,
I changed my xml to make my returned columns looks similiar as yours.
Formula Query4:
Query3 without invoking Query4:
This is the result:
Query3 invoking Query4:
This is the result:
Query4 works well in my local. The second column's name has updated to "init-param".
So I hope you can change your parameter of Query4 to table and try again.
Best Regards
Alex
Hi,
You need to define your parameter using table type: (DataSetTable as table) =>.
Because the return type of Table.RemoveColumns() is a table and there is no automatical conversion for table/list/record. You have to convert it yourself.
I changed your code in Query4 to show parameter only.
This is my xml:
This is the result:
If you defined you parameter of Query4 using record type parameter,
You must change your input parameter to record. See sample code below.
This is the result:
It is the same for list type. If you defined you parameter of Query4 using list type parameter,
You have to send a list type value to it.
This is result:
Best Regards
Alex
AlexChen, thanks. That helps me understand the language a little better.
But your example is basically different from mine. You have three columns, each a text field, and have to convert it to a table in order to pass it to Query4 (when that query accepts a table as the parameter).
However, my example already has the columns containing tables. As you can see in the screen shot highlighting "Removed Columns1", there are two columns and each contains a table. I can click the icon at the upper right of each column to expand the table. But I don't because I want to pass each of these as a table and let Query4 deal with the entire table.
If I remove the "DataSources" column also (in the "Removed Columns1" step), that leaves just the "DataSets" column which contains a table. And the step to execute Query4 works perfectly: "Removed Columns1" is a table which displays as a row with one column that contains a table that can be expanded, and that table is passed to Query4 perfectly.
However, if i keep the "DataSources" column so that the row has two columns each of which contains a table, I can't find a way to pass that row to Query4 so it can process the two tables just as if it had opened the XML file and removed the extraneous columns.
Any ideas how to do this? I need it to pass a flexible record structure (e.g., sometimes the "DataSources" column will be present and sometimes it won't) and let Query4 handle that structure.
Thanks for your help.
- AlexChen9 years agoMicrosoft Employee
Hi,
I changed my xml to make my returned columns looks similiar as yours.
Formula Query4:
Query3 without invoking Query4:
This is the result:
Query3 invoking Query4:
This is the result:
Query4 works well in my local. The second column's name has updated to "init-param".
So I hope you can change your parameter of Query4 to table and try again.
Best Regards
Alex
- SamTrexler9 years agoHelper IV
AlexChen, it works perfectly now. I know I tested with Query4 taking a table as a parameter - even as recently as yesterday. I'm not sure what's changed, but it's working now with the help you've given. Thanks so much.