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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to pull back data ...
Power Apps
Unanswered

How to pull back data from Sharepoint list into controls on screen - without using datacards

(0) ShareShare
ReportReport
Posted on by 514

I have a screen with various controls - text boxes mainly, but also a few toggle buttons and combo boxes.

I am not using forms or datacards.

I saved data from the screen using a Patch command to a Sharepoint list.

Now I am trying to get the data back based on a condition & populate all the controls on the screen.

I understand one way is to use a collection, but I can't get it to work.

 

Basically I want to click a record in a gallery and then it takes the ID of the record and pulls back the data from the list. It then navigates to another screen and then each form control is populated with its corresponding data item. 

 

Any example appreciated.

 

Thank you

 

 

 

 

 

Categories:
I have the same question (0)
  • R3dKap Profile Picture
    1,594 on at

    Hi @sienna28,

     

    First you should add your list MyList as a datasource for you application. Let me know if you need any help on this...

    Then, I guess your gallery data source should be set to MyList...

    Then, once you click on the item in the gallery, you navigate to your edit screen passing the ID of the item...

    Then, on your edit screen, in the OnVisible event, you do something like this:

    ClearCollect(VAR_MyListItems,MyList)

    And finally, on each control in your edit screen, you set their Default property to something like this:

    VAR_MyListItems.FieldName

    But then, depending of the datatype of the field, it could get more complicated...

     

    Hope this helped a bit...

     

    Just one question though: why recreating everything from scratch when PowerApps forms and datacards provide all that's needed to manage list items ?

  • sienna28 Profile Picture
    514 on at

    Hi

     

    Thank you for your reply.

     

    I used cards before, but this time I am finding it hard to position controls so decided not to use forms, datacards.

    Also I think I can only add controls/cards to the form that are bound to the datasource. I have a people picker which is not bound to the same datasource as the form so it seems I cannot use it within the form.

     

    I will try your solution now.

     

    Thank you

  • R3dKap Profile Picture
    1,594 on at

    I understand... Nevertheless, it seems your decision to drop the use of native PowerApps forms might be based on an ignorance of what you can achieve with PowerApps and I could help you on this.

     

    About the positionning of datacards, I was able to create forms with this look and as you can see you can do almost position your datacards as you want:

     

    Custom SharePoint form

    Image 7.png

     

    A PowerApps application using SharePoint lists as datasources

    Image 10.png

     

    Finally, PowerApps allows you to mix as many datasources as you want in one application. For instance, the SharePoint customized form in the first screen shot above uses about 10 SharePoint lists to work properly.

     

    I hope I have convinced you to go forward with the native forms... but of course it depends of what you want to achieve in your application/form. Maybe if you can share a bit about it... 🙂

  • sienna28 Profile Picture
    514 on at

    Your forms look good.

     

    I find I can't just drag controls where I want - they decide where they want to sit.

    I'm not the only one - a quick Google search will show the amount of frustration people have with datacards.

    I have a control which is not bound to the form, but the data it has should be saved to the datasource behind the form. Microsoft say only one datasource can be used per form. It is a combo box filled with names from office365. The selection should be saved to the datasource behind the form. Unless it sits in a datacard which is bound to the same datasource of the form, I can see no way this can be done.

  • sienna28 Profile Picture
    514 on at

    I have decided to adopt your card approach.

     

    It's working a little better now.

     

    I created  a custom card to hold my combo box with the different data source. I hope this is the way to go about it because I could find no way of positioning it unless it was in a card.

     

    Whether I can save that value to the main data source behind the form and also bring it back is something you may be able to show me.

     

     

  • Verified answer
    R3dKap Profile Picture
    1,594 on at

    About the dragging and positionning of datacards, here are a few things to know:

    1. Datacards can't be moved or reordered in the left "menu" of the PowerApps web studio
    2. Datacards are positionned automatically by PowerApps so that they occupy all the space around them -> which should make these screens responsive
    3. Datacards coordinates are not real pixel X,Y coordinates; they are just positions... let me explain:
      As you can see on this capture, I chose to divide my screen into a 4-columns screen; so any datacard will necessarily have a width of 25%, 50%, 75% or 100% (if you want smaller-width datacards you will have to increase the number of columns of your screen):
      a
      Image 11.png
      b
      Image 13.png

      Now, as you see below, datacards position on the Properties tab are in pixel but their X and Y properties on the Advanced tab uses a Column,Row positionning system:
      Image 16.png

      So, an entire screen would look like this (each X,Y coordinate represents the upper-left corner of a datacard):

      Image 14.png

      This means that I had to create an empty datacard and place it in X=1,Y=5 so that my data card at X=2,Y=5 stays in that location.

    4. Moving datacards around can only be performed through the panel that shows your data source/datacards: there you can move them up or down to sort them out... Once sorted, you resize their width (only) using the grips. If you notice that they always take the largest width they can, try unticking the checkbox called Width fit on its Properties tab.
      Image 21.png

    5. Controls INSIDE a data card are positionned using X,Y pixels coordinates, relatively to the upper-left corner of the datacard (uper-left corner of data card content is X=0,Y=0).

     

    That said, about the multiple datasource... You are right: you can have only ONE datasource PER FORM (which means that every datacard on the form is attached to that datasource)...

    Image 22.png

     

    But you can have multiples datasources associated with your screen:

    Image 23.png

     

    So, if you need to update multiple datasources from one form, I see two options:

    1. In your form your create a custom datacard which is not connected to any datasource and in the OnSuccess event of the form you use the Patch function to update your second datasource from the value within your custom datacard (and in the OnStart event of the screen load the data from the second datasource and insert it in your datacard's controls).
    2. You add a second form in your screen that will be connected to the second datasource -> then on the OnSave event of the SharePointIntegration control (or on the Save button of your app), you submit BOTH forms using the SubmitForm function.

    Have I convinced you yet ? 😄

     

     

  • sienna28 Profile Picture
    514 on at

    Hi

     

    Thanks for the explanation - I am not great with co ordinates, but decided to take your advice and went back to using the cards. I managed to get it all working. For the combo box with the other data source, I used a custom card and put it in there. I set the upate property of the card to the selected value of the combo box. It seems to save ok to the list.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard