cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
pradeepjain
Microsoft
Microsoft

How to create Dynamic table whose columns change based on user input

Hi Team,

 

Currently I am building an PowerApps, where based on user selection values from a couple of combo boxes, I am creating a SQL Query , which i then store to a variable and pass it to a flow, which runs the query in a "Execute SQL Query" module and returns back the output using the Response module. Please find below the flow :

pradeepjain_0-1655748108356.png

 

I then the store the response in a collection and then display it using Data table. This was working  fine , till I had fixed set of columns.

 

Now based on the user selection input , the  query will keep changing and so will be the output columns to be displayed.  So the response section where we define our columns, will need to be to changed every time  and also in Data table in power apps, we have manually select the columns to be displayed , that will need to changed every time based on the resulting columns.

 

Can anyone share any tips, as to how can this process by done dynamically ?

 

Can galleries be used ? if so do we need to change the source of the gallery every time ? how can that be done dynamically ? 

 

Thanks again

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @pradeepjain ,

 

The response action only supports fixed data structures.

  • If the data structure of the data table returned by Execute SQL Query is fixed, then nothing needs to be modified and it will work fine.
  • If the data structure of the returned table is flexible, then it will not work(When the data structure changes) and I'm afraid there's not a good solution to this need at the moment.

 

Best Regards,

Bof

View solution in original post

2 REPLIES 2
v-bofeng-msft
Community Support
Community Support

Hi @pradeepjain ,

 

The response action only supports fixed data structures.

  • If the data structure of the data table returned by Execute SQL Query is fixed, then nothing needs to be modified and it will work fine.
  • If the data structure of the returned table is flexible, then it will not work(When the data structure changes) and I'm afraid there's not a good solution to this need at the moment.

 

Best Regards,

Bof

pradeepjain
Microsoft
Microsoft

Thanks for the info

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,281)