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 / GalleryScreen -> EditF...
Power Apps
Answered

GalleryScreen -> EditForm Datasource Problem

(0) ShareShare
ReportReport
Posted on by 67

Hello Community,

 

hope you can help me with my little Problem. 

I have multiple Sharepoint Lists as a Datasource and try to realize the following.

On the first Screen i have a GalleryControl to visualize Data from the main datasource (List 1) but also data from 

other Lists that are in relation with List 1 (via an ID).

 

So for example in List 1 (Members) i have the follwing Data

Members

Name   Adress            City             ID

Frank   TestStreet        Barcelona   15

Jack      TestStreet 3    Budapest    16

 

List 2 (TravelAndWorkingExperience) contains the following 

TravelAndWorkingExperience

ID  Country        Member ID

1    Austria           15

2    Spain              15

3    Netherlands   15

4    Austria            16

 

To combine these Lists for the Gallery Items property i use the follwoing command

AddColumns(Members, "TravelCountry", Filter(TravelAndWorkingExperience, 'Member ID' = Members[@ID]))

 

To show the data i set the Text property for the label to ThisItem.Name to get the Name of the Members List and 

to show the TravelAndWorkingExpirence Countries i set the Textproperty to Concat(ThisItem.TravelCountry, Country.Value, ","). 

 

This works so far :).

 

Now i have a 2nd Screen with a Editform. I tried to set the DataSource of the Editform to Members and the Item Property to PersonResult.Selected (PersonResult is the Name of the GalleryControl from the first Screen). 
This way i get the Errormessage Invalid formula. Expected a value compatible with 'DataSource'. I did a little research and found that the Datasources have to be the same, which maybe means in my case that i modifed the Datasource of the Gallerycontrol with the AddColumns Function? 

 

So now i tried a workarround by setting the first Screens OnVisible property to 

ClearCollect(MemberResult, AddColumns(Members, "TravelCountry", Filter(TravelAndWorkingExperience, 'Member ID' = Members[@ID]))) to use MemberResult as the Value for the Gallerys Item Property.

I then set the DataSource of the EditForm to MembersResult. Now i get the Results i want, BUT 😄 now the Formcontrol blames me that "This form isn´t connected to any data yet. Connect to data", so i guess the SubmitForm Function won´t work too?

 

Is there a easier way to realize the functionallity i am trying to realize? (hope so :))

 

thx much in adv

 

Manni

Categories:
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @MB29 

    Keep your Form datasource as-is.  The problem is that you are adding a column to the item that you are passing to the Form.  That will not conform to the datasource and you will see the error.

     

    So, one quick way around it is to Drop the Column.  However...DropColumns only works on tables, so we need to pull a little trick on it.  Here is what you want for your Item property:

       First(DropColumns(Table(PersonResult.Selected), "TravelCountry"))

     

    This will first convert the Selected item in the Gallery to a table then apply the DropColumns to that table to get rid of the column, then return the First record (which there was only ever one anyway).

     

    Hope this helps.

  • MB29 Profile Picture
    67 on at

    Hey @RandyHayes ,

     

    thx much for your answer.

     

    That helped with the Selected Problem thx but i still have the issue that the Form says it is not connected to any data yet. Do i just have to ignore that and Patchupdate the Form or does the SubmitForm still work ?

     

    thx

  • MB29 Profile Picture
    67 on at

    ah ok i think i got it. 

     

    i can still use Members as the EditForms Datasource but with the Items workarround like you suggested.

    So i don´t have a problem with the Dataform Data connection.

     

    br Manni

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @MB29sorry, when I mentioned "keep your data source as-is".  I meant that you should set it to the underlying datasource, not to your collection.  That will solve the issue you are seeing and put you back to working order.

     

    However...for reference, you CAN tie a form to a collection, but you will need to do all the plumbing to get form actions back to your underlying datasource - and you will see that message.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 350 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 318

#3
Mohsin Ali Profile Picture

Mohsin Ali 220

Last 30 days Overall leaderboard