cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PowerApps11
Helper III
Helper III

One form use two datasource

Hi 

 

I have 2 data source SharePoint they both use the same contact list so is there a way I can use it if navigated to the contact list form to show the correct record so I can edited?

Thanks

2 ACCEPTED SOLUTIONS

Accepted Solutions
CNT
Super User
Super User

@PowerApps11 Assuming that by 2 data sources, you mean 2 share point sites with exactly the same List (and columns), you can add both these data sources to the APP and then use an If statement to choose the correct one.

View solution in original post

Hi @PowerApps11 ,

 

One Form can have only one data source, set in DataSource property of the Form. Back to your scenario, since you will always need to modify the contact in the contact list, you should set the DataSource of the EditForm to be Contact list. Then the point is an EditForm will allow you to edit only one record which is set in Item property. So, below would be the detailed steps:

1. Set a variable when navigating from Projects Gallery and Tasks Gallery OnSelect of the Buttons:

Set(varContact, ThisItem.ContactName);Navigate(ContactDetailScreen)

 

2. DataSource of the Contact Edit Form:

ContactList

 

3. Item of the Contact Edit Form:

LookUp(ContactList, ContactName = varContact)

Replace ContactName with the column name in your Contact list.

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

6 REPLIES 6
CNT
Super User
Super User

@PowerApps11 Assuming that by 2 data sources, you mean 2 share point sites with exactly the same List (and columns), you can add both these data sources to the APP and then use an If statement to choose the correct one.

Hi @CNT 

The 2 list is like tasklist and projectlist but they both share on contact name which is coming from contact list all I need is to be able to modify the contact details from both list when I navigate either side to contact list form to be able to modify 

thanks 

@PowerApps11 Is Contact Name in the tasklist and projectlist a lookup column to the Contact List? Can you share some screen shots of the App?

@CNT 

If understood  you what you mean is if I have both list  a lookup column in backend sharepoint? 
the answer is no

 

Hi @PowerApps11 ,

 

One Form can have only one data source, set in DataSource property of the Form. Back to your scenario, since you will always need to modify the contact in the contact list, you should set the DataSource of the EditForm to be Contact list. Then the point is an EditForm will allow you to edit only one record which is set in Item property. So, below would be the detailed steps:

1. Set a variable when navigating from Projects Gallery and Tasks Gallery OnSelect of the Buttons:

Set(varContact, ThisItem.ContactName);Navigate(ContactDetailScreen)

 

2. DataSource of the Contact Edit Form:

ContactList

 

3. Item of the Contact Edit Form:

LookUp(ContactList, ContactName = varContact)

Replace ContactName with the column name in your Contact list.

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

PowerApps11
Helper III
Helper III

Hi @CNT  and @v-jefferni 

 

Thanks actually i have used if statement and it worked it is just bit delay showing like 5 second but apart that everything else is working 

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

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