cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JTA88
Frequent Visitor

Edit form submit not working with AddColumn data source

Hi - if anyone can help me solve this I will be eternally in their debt...

 

I'm trying to create a library subscriptions app. I was struggling with getting the correct names for my Subscriptions gallery fields, which someone was kind enough to help me with here.

 

Now that I'm working with a gallery featuring additional columns, though, the detail and edit forms associated with these gallery items are proving problematic.

 

They both display the "Connect to Data" message, although my data is still showing over the top of them. Going by the solution to this post I have made sure to change the DataSource from my Browse Gallery name to the actual formula for my custom data source with added columns; but the "Connect to Data" message still shows.

 

This isn't the end of the world, as it's not visible in play mode and the data displays fine. Everything seems to be working, EXCEPT my submit form button. If I click it when creating a new record, nothing happens. If I click it when trying to edit an existing record, I get the "There was a problem saving your changes. The data source may be invalid" error message, as queried here.

 

I have tried everything I can think of; I've gone through every line of code I've written, I've remade the forms from scratch, I've saved, published, exited, re-entered, you name it. Nothing seems to work.

 

What's super frustrating is that these forms were working and submitting fine a week ago, so I don't know what's gone wrong. I previously had the idea of linking multiple galleries to the same edit form, and was playing around with that as an option, but soon realised it wasn't necessary for the app and so removed all the extraneous code. That's when it seemed to completely break.

 

This is the final thing I really need to fix before I demo this thing. Praying someone out there has an answer...

1 ACCEPTED SOLUTION

Accepted Solutions
Drrickryp
Super User II
Super User II

@JTA88 

You have to maintain consistency between the datasource in the form and the datasource and item property of the forms. In the example on the right, the datasource of the gallery is 

 

With(
    {
        wcontacts: AddColumns(
            FakeNames,
            "citystate",
            city & ", " & state
        )
    },
    SortByColumns(
        Search(
            wcontacts,
            TextSearchBox2.Text,
            "company_name"
        ),
        "company_name",
        If(
            SortDescending1,
            SortOrder.Descending,
            SortOrder.Ascending
        )
    )
)

 

The Item property is Lookup(FakeNames, ID=Gallery1.Selected.ID) and the datasource of the form is FakeNames.  It functions perfectly. 

_1.png

View solution in original post

2 REPLIES 2
Drrickryp
Super User II
Super User II

@JTA88 

You have to maintain consistency between the datasource in the form and the datasource and item property of the forms. In the example on the right, the datasource of the gallery is 

 

With(
    {
        wcontacts: AddColumns(
            FakeNames,
            "citystate",
            city & ", " & state
        )
    },
    SortByColumns(
        Search(
            wcontacts,
            TextSearchBox2.Text,
            "company_name"
        ),
        "company_name",
        If(
            SortDescending1,
            SortOrder.Descending,
            SortOrder.Ascending
        )
    )
)

 

The Item property is Lookup(FakeNames, ID=Gallery1.Selected.ID) and the datasource of the form is FakeNames.  It functions perfectly. 

_1.png

View solution in original post

JTA88
Frequent Visitor

THANK YOU!!! I owe you a beer 👍

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,028)