cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
MB29
Level: Powered On

GalleryScreen -> EditForm Datasource Problem

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

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: GalleryScreen -> EditForm Datasource Problem

@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.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

4 REPLIES 4
Super User
Super User

Re: GalleryScreen -> EditForm Datasource Problem

@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.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

MB29
Level: Powered On

Re: GalleryScreen -> EditForm Datasource Problem

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
Level: Powered On

Re: GalleryScreen -> EditForm Datasource Problem

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

Super User
Super User

Re: GalleryScreen -> EditForm Datasource Problem

@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.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 195 members 5,268 guests
Please welcome our newest community members: