Skip to main content
Community site session details

Community site session details

Session Id : wyKnpJrG6CnV0PrvucJ7ZJ
Power Pages - General Discussions
Answered

Merging two Dataverse Tables in a View

Like (0) ShareShare
ReportReport
Posted on 18 Jan 2024 13:10:36 by 27

I have the following view

Amad233_0-1705582942991.png

The above is from a single table.,

I have 2 tables from Dataverse containing similar informations like:
   Reference, Date Submitted, Company, Status

 

There are no foreign keys or lookups relating the table.

 

Taking as example as using UNION in sql, how can I merge the two tables into a single view??
I am currently using either API or fetchXML to display data on my PowerPage website.

 

If anyone of you have met the same situation or know how to resolve the problem
Any help is appreciated

Categories:
  • Lucas001 Profile Picture
    2,268 Super User 2025 Season 2 on 19 Jan 2024 at 10:45:43
    Re: Merging two Dataverse Tables in a View

    Hi @Amad233,

     

    hope you will be able to implement your solution.

    Could you accept one or more posts as a solution? It helps to us when looking for open posts to solve.

     

    Actually there are a lot of active members in the power pages community. Do you have other open posts?

     

    In case you have any more issues or questions, please feel free to ask or open a new post.

     

  • Amad233 Profile Picture
    27 on 19 Jan 2024 at 07:15:33
    Re: Merging two Dataverse Tables in a View

    It's kinda sad though.

    Dataverse huh 😂

    It's supposed to be super powerful

    Cannot even do a UNION

    Guess I'll have to create another table then, easiest and most manageable solution (In my opinion)

    Thanks Guys

    This is the first time people are replying to my post.  Really appreciate it 👍

    @Lucas001 @domliu @fm_skeller 

     

  • Verified answer
    Lucas001 Profile Picture
    2,268 Super User 2025 Season 2 on 19 Jan 2024 at 06:39:36
    Re: Merging two Dataverse Tables in a View

    Hi @Amad233,

     

    I guess both of the others already point out a good example on how the problem could be solved.

    There are some more things I would like to ask:

    1. If the data is kind of similar, is it really necessary to store them in two different tables?
    2. Is there a column which could connect both tables? If so you could use a reference like a formula column and combine everything in one big table or further extend one of the two existing.
    3. The best approach here would probably be to use fetchXML as already pointed out and get 2 querys running. Join the two JSONs, or arrays, depending on how you set it up in one variable. After that use a for-loop or a for each and display the view on your page while populating the DOM as needed.



    --------------------------------------------------------------------------------------

    Hope that helps.

    If the post solves your problem, please mark it as solution. If it helps, consider a thumbs up.

  • domliu37 Profile Picture
    314 Super User 2024 Season 1 on 18 Jan 2024 at 19:57:34
    Re: Merging two Dataverse Tables in a View

    Hi @Amad233 ,

     

    I dont believe there's any ootb way to achieve that. As you already use fetchXML to retrieve data, maybe just use 2 fetchXML to retrieve the data from both table, then use code to display the data in a single view, make sure have the same columns etc.

     

    ----------------------
    If you enjoy this post, click the thumbs-up button. If it helped you, mark it as a solution so others can find it easily.

    Cheers,
    Dom

  • Verified answer
    fm_skeller Profile Picture
    277 Moderator on 18 Jan 2024 at 16:03:53
    Re: Merging two Dataverse Tables in a View

    As far as I know you cannot do a union-like statement with views and/or liquid. You could use the API or FetchXML to query both tables and use liquid/javascript to combine both into 1 table.

    You could also create a third table, where you add new rows whenever either table is modified - and display that table.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Loading complete