cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
omkarb26011
Helper I
Helper I

Add a record to a Dataverse table only if a column contains data from another Table's column

Hi All!

 

I have a requirement where a Record is added only if data is present in same column of a master table.

So For Example :

Master Table contains a column TeamName with Teams: A, B, C

So only these 3 teams should be allowed to add in another Table's Teams column

If the team Name is different than the one in master table then it should not be allowed or should throw an error while adding a new record

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
rampprakash
Super User
Super User

Hi @omkarb26011 

 

Create a plugin in Pre-Validation and Validate the same and throw the error.

View solution in original post

8 REPLIES 8
rampprakash
Super User
Super User

Hi @omkarb26011 

 

Create a plugin in Pre-Validation and Validate the same and throw the error.

joaodsantos
Resolver III
Resolver III

Hi,

Depending on your model this should be achievable.

If you have a structure of:

Master Table  -< Master Table's Teams  >- Teams

               |               /

              Child Table

So, a table for all teams, a new one for Teams that belong to the Master Table.

With this you can link whatever teams you want on the master table, and from the child table you then have a lookup to the Master Table's Teams (N:1 Relationship)

Then on the Child Table's form use a Filtered Lookup to only show Master Table Teams that are already linked to the Child Table's Master

Once you select the Lookup field on the Child Table's form you'll see these options:

joaodsantos_0-1664889019140.png

 

You should be able to select the Master Table lookup. This will ensure you only see teams from the Master.

 

hope this helps and that I didn't make it too confusing

AhmedSalih
Super User
Super User

Hello, @omkarb26011, How do your users interact with your Dataverse? Model-Driven App or Canvas App?

 

 

If my reply helped you, please give a 👍 , & if it solved your issue, please 👍 & Accept it as the Solution to help other community members find it more.


I am primarily available on weekdays from 6-10 PM CT and 5-10 PM CT on weekends.


Visit my Blog: www.powerplatformplace.com


 

 

Hi @AhmedSalih.

 

Thanks for the response.

I am using a canvas app to interact with Dataverse.

I need this validation in backend- Dataverse side

@omkarb26011, you said: So only these 3 teams should be allowed to add in another Table's Teams column >> You mean that those three teams can create new Table's Column ??

 

 

If my reply helped you, please give a 👍 , & if it solved your issue, please 👍 & Accept it as the Solution to help other community members find it more.


I am primarily available on weekdays from 6-10 PM CT and 5-10 PM CT on weekends.


Visit my Blog: www.powerplatformplace.com


 

 

No @AhmedSalih 

For example I have a teams master table which will have team data -> Team Name.

So number of Teams is not fixed it will vary and increase as per the requirement.

Now I have another table say PersonalData where I am entering the name of the person with his team.

What I want is that Dataverse should not allow/ save data if I enter any other team name apart from the one available in team's table

 

HI @rampprakash can you please provide me some links or previously solved use cases regarding the same

rampprakash
Super User
Super User

Hi @omkarb26011 

 

Please find my attached Video https://www.youtube.com/watch?v=BNpqbt8NDhw

 

Please mark as Answer if it is helpful and provide Kudos


Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
Follow me on Twitter : @rampprakashd
Blog : https://microsoftcrmtechie.blogspot.com

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Users online (6,381)