web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : Wa4ACAfKPCiVkABfaCKUGM
Power Apps - Building Power Apps
Unanswered

Re-create dynamically a collection (using a custom API and not knowing the structure in advance)

Like (0) ShareShare
ReportReport
Posted on 28 Mar 2017 13:33:01 by 19

Hi,

I'm building an app where I request for a set of data using a custom API (TestConnection).
I successfully get back data and assign them to collections without knowing the structure in advance.

But is it possible to create dynamically a collection that has the same structure? I can have the same result if I know the structure in advance (I just create the same fields inside a ClearCollect, as the structure of swagger) but what are the chances to get it automatically?


From DataBase

ClearCollect(CollLine, TestConnection.CollLineGetAllCollLines())

 

Capture.PNG

 

Manually:

Collect(CollLine, {Name: LDescriptionInput_2.Text, WorkType: WTDropdown1.Selected.WorkType, StartTime: StartTimeInput_2.Text, EndTime: EndTimeInput_2.Text, TotalTimeH :hours, TotalTimeM : minutes, Project: ProjectDropdown_2.Selected.PName, DayField: DayFieldDropdown_2.Selected.MyDay, WeekField: WeekFieldDropdown_2.Selected.WRName, Comments:NotesTextInput.Text }); UpdateContext({showDialog:true}); UpdateContext({hourflag: ETDropdown.Selected.h, minflag:ETDropdown_.Selected.m}); 

 

Categories:
I have the same question (0)
  • christinadot Profile Picture
    19 on 30 Mar 2017 at 15:00:17
    Re: Re-create dynamically a collection (using a custom API and not knowing the structure in advance

    Hi @v-micsh-msft,

     

    Right. By saying dynamically, I meant to get the Collection structure without the data from the Custom API in order to use the same method for many cases & structures and not have to write the fields one by one.

    It's a pitty that we cannot have it but any case, we can write the function, is not really a big deal.

     

    Thank you very much for your response.

     

    Best,

    Christina

  • v-micsh-msft Profile Picture
    on 30 Mar 2017 at 07:31:36
    Re: Re-create dynamically a collection (using a custom API and not knowing the structure in advance

    Hi @christinadot,

     

    I am a little confused about "Re-create dynamically a collection" here.

    If you use Custom API, the data structure should have been defined already within the swagger.

    And the "From Database" formula you used here should be the right formula to create the collection.

     

    By saying dynamically, do you mean to get the Collection structure without the data from the Custom API?

    Based on what I know, there is no available ways.

    Please post back if I have anything misunderstood.

     

    Regards

    Michael Shao

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Tom Macfarlan – Community Spotlight

We are honored to recognize Tom Macfarlan as our Community Spotlight for October…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 885 Most Valuable Professional

#2
developerAJ Profile Picture

developerAJ 571

#3
Michael E. Gernaey Profile Picture

Michael E. Gernaey 352 Super User 2025 Season 2

Last 30 days Overall leaderboard