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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Creating a Form like s...
Power Apps
Answered

Creating a Form like structure with Collections as a Data source

(0) ShareShare
ReportReport
Posted on by 20

Hello,
I am working on a stuff which requires me to generate a form like structure by using Collections as a data source. Tried using Forms with Collections, got to know that it's not a valid data source for Forms.
I am attaching the JSON below for reference.

 

I want to display the 'Key' (as label) along with the value (Text Input) in Form/Form like structure, It would be great if I get these fields dynamically populated once I click a button, I don't want to hard-code the fields and Text-Input.

Thank you!

JSON.PNG
Categories:
I have the same question (0)
  • PTBBSolutions Profile Picture
    691 on at

    Hi @Rohit_RC ,

     

    What do you mean by "Collection is not a valid data source for Forms"? You can use a collection in your form, just change your Item property to First(YourCollectionName).

     

    BTW, are you sure this is the way you want you collection to be structured? I think that you need to have all data in 1 row and not on multiple.

  • Rohit_RC Profile Picture
    20 on at

    @PTBBSolutions  Thanks for replying
    If we use Data sources like Excel, Dataverse tables for Edit forms, the fields (labels and text inputs) are automatically populated, in the same manner, if my data source for Edit Form is a Collection, I want the fields(Labels and text inputs) to populate automatically.
    please suggest any alternatives accordingly

    At present, I have created labels and text inputs in a blank vertical gallery, Please find the pic attached to this answer
    I want the same to get populated in a Edit Form automatically based on my collection's key-value pairs.

    Form.JPG
  • Verified answer
    PTBBSolutions Profile Picture
    691 on at

    Hi @Rohit_RC ,

     

    I have a collection which is created from a button click the following way:

    Collect(MyCol,{userLabel: "User ID",passwordLabel:"Password"})

    I also have an edit form with the following attributes:

    1) DataSource: MyCol

    2) Item: First(MyCol)

     

    After that I manually add datacrds in the edit form:

    PTBBSolutions_0-1636704829851.png

    After you have created a datacard, add a control in it (label or text input or whatever you want).


    Set the Text property of your control (if it is a label) to /e.g/ ThisItem.passwordLabel.

     

    This way your form will be always dynamic based on your collection:

     

    PTBBSolutions_1-1636705017022.png

     

     

  • Rohit_RC Profile Picture
    20 on at

    Hi @PTBBSolutions ,
    First(Collection_Name) will only return the first element
    I want all the elements in the form fields, and moreover ThisItem.passwordLabel will give the value associated with "passwordLabel" key.

    The following is my collection : 

    Collect(
    CustomCollection,
    {userLabel: "User ID"},
    {passwordLabel: "Password"},
    {forgotUserId: "Forgot user ID?"},
    {forgotPassword: "Forgot password?"},
    {keepMeIn: "Keep me signed in for 2 weeks"},
    {saveUserId: "Save user ID"},
    {signInButton: "Sign in"},
    {cancelSignInBtn: "Cancel"},
    {dontHaveId: "Don't have a user ID?"},
    {createUserNow: "Create one now"},
    {eRepairSignInWithPhoneNumber: "Sign in with phone number"}
    )

    based on the above collection, what I want is to display an edit form in the following way : 

    userLabel (as a label) : User ID (in a text Input, so that it can be edited)
    passwordLabel (as a label) : Password (in text Input, so that it can be edited)
    .
    .
    so on and so forth

    I don't know if this is possible with a form. If this is not a viable way to solve this problem, alternative solutions will be much appreciated .

    Thank you.



  • Rohit_RC Profile Picture
    20 on at

    hi @PTBBSolutions , hope you're doing good.

    I have a use case scenario wherein we have a JSON file stored in Dataverse. How can we display the content from the JSON file (stored in Dataverse) in rich text editor control in canvas app.
    I am using a Attachment control available in Form, through which I am able to upload JSON files into the Dataverse, I want the JSON file's content stored in Dataverse to be displayed.

    I am trying to use a Flow, but unable to figure out.

    Thank you.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 505

#2
WarrenBelz Profile Picture

WarrenBelz 502 Most Valuable Professional

#3
Haque Profile Picture

Haque 324

Last 30 days Overall leaderboard