Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
8 replies
Subscribers
7 subscribers
Views
5251 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
merging two different data sets in a grid
Richard
over 7 years ago
I have a data store based cdt and a set of online data from another system (accessed via a!httpQuery) that I'd like to merge in a grid, is there a recipe for such an action?
Each row in the CDT may or may not have a corresponding item in the dataset taht comes back from the REST query.
OriginalPostID-242185
Discussion posts and replies are publicly visible
0
Mike Schmitt
Certified Lead Developer
over 7 years ago
If you can merge them into a local CDT/dictionary variable in any meaningful way, I think you can then just go ahead and display that in a paging grid. I think you will probably need to load every item in each of the two data sets in advance (so it won't work for large or very large data sets, but should be OK for medium or small ones).
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Richard
over 7 years ago
I'm just arriving at that conclusion myself, is there a simple way to match the two data sets up into an aggregated CDT?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Mike Schmitt
Certified Lead Developer
over 7 years ago
There may be a more graceful way of doing this that I'm not thinking of, but as far as I know you might need to manually aggregate field-by-field into a new CDT or dictionary in your local variable. I would suggest (mainly for sanity's sake) querying the 2 parent data types into their own local variables first, i.e. local!appianDataSet & local!httpQueryDataSet
So you might do next:
local!aggregatedData: {
fieldA: append( local!appianDataSet.fieldA, local!httpQueryDataSet.AField ),
fieldB: append( local!appianDataSet.fieldB, local!httpQueryDataSet.BField )
...
},
(then within your with()):
local!dataSubset: todatasubset( local!aggregatedData, local!pagingInfo ) ...
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
rawich
over 7 years ago
This is a recipe that should help you find the right match between array of CDTs from DB and the ones from REST query:
forum.appian.com/.../Function_Recipes.html
You actually don't need to merge them, just need to arrange them in the same index order, then you can use them to create a paging grid.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sowjanyav430
over 7 years ago
Please go through the link:
forum.appian.com/.../Function_Recipes.html
It will be really helpful....
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Sachin
A Score Level 1
over 7 years ago
@Richard is there any common column between the two CDT
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Rama Thummala
Certified Lead Developer
over 7 years ago
@richard
Please check joinCdt() , used to join two cdt s data.It works similar to SQL joins.
I haven't tried, it might solve ur case.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
davidg707
over 7 years ago
if they have the same data structure then you can append the new data to the existing datasubset. you could use joinCDT, although i'd recommend probably making your own wrapper CDT that contains columns from both data structures.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel