cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
powerapps890
Post Prodigy
Post Prodigy

Send form to different datasource

Is there a way to send a form to a different data source that it's originating one? The other data source has identical columns. I just want to store it in a different one as well as the original. I want to keep the original in the sharepoint list then have another in a different one.

16 REPLIES 16
RandyHayes
Super User
Super User

@powerapps890 

You cannot have the SubmitForm redirect to another datasource.  However, you could implement a Patch in the OnSuccess of the form to put that information in another list.

You can reference the yourForm.LastSubmit properties to get the values you want to put in the other list.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

What is the syntax for this? I tied  Patch('NewDatasource', Form1.LastSubmit.Title, Form1.LastSubmit.ID....) but that isnt working. @RandyHayes 

RandyHayes
Super User
Super User

@powerapps890 

Well, the first question would be, are you trying to create a new record in 'NewDatasource' or update an existing?

 

If you are updating an existing, then what it the identification of the unique record you want to update in that datasource?  I see .Title in your formula...does that mean that Titles are unique and that the currently submitted record from your form will match the newdatasource by Title?  Or is it something else?

 

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

I am just trying to forward what was already submitted in the  original datasource to the new onw but there is also one new field I want to include that is not in the original submission but I have it as a blank column in the original datasource. I am using varRecord and each varRecord has a unique ID. I was just using title because it is my first column in the datasource. @RandyHayes 

RandyHayes
Super User
Super User

@powerapps890 

I am not completely following you.

What I am asking is, if a user Submits a form (to the original) are you then wanting to CREATE a new record in the newdatasource?  OR are you expecting to both be able to create a new record if it DOES NOT exist in newdatasource AND update a record in newdatasource if it already exists?

 

If it is that you want to create a new record each time, that is easy.  If you want to create and also update if exists, then I need to know what the indication of an existing record would be.  It can't be ID.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

I want to create and update. Can I just use the title as it will be unique? @RandyHayes 

RandyHayes
Super User
Super User

@powerapps890 

Yes, that was what I was going for...needed to know what the unique column would be to lookup to determine if the record existed already or not.

 

So, your OnSuccess formula would be something like this:

Patch('NewDataSource', 
    Coalesce(LookUp('NewDataSource', Title=Form1.LastSubmit.Title), Defaults('NewDataSource')),
    First(
        ShowColumns(Table(Form1.LastSubmit), 
            "Title",
            "ColumnA",
            "ColumnB",
            ...etc...
        )
    )
)

Now, replace the list of your field names in the showcolumns block above and this will give you what you want.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

I am getting these errors on some saying the column is like another one and some say that's not a column even though both datasources are exactly the same. @RandyHayes 

RandyHayes
Super User
Super User

@powerapps890 

First, make sure that your columns are REALLY exactly the same.  The easiest way to do this is to go into the list settings in SharePoint and click on one of the columns - High Level Request Description to start with.  Then once you've clicked on that, look at the URL in the browser.  At the very end of the URL will be a field=....  Whatever is shown there is the exact name of the column.  Then look at your other list and the same column and see what its real name is. 

If there are ANY discrepancies with the names, then we need to take a slightly different approach (but a bit lengthier).

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,235)