Jump to content
  • 0

Using "related Field" Of Relationship In A Details Report Datapage


financemy
 Share

Question

Hi there - quick question about relationships.


 


I've created a relationship between two tables using the Relationship Settings dialog, and set the "Value for display in Related Field" to the desired field.


 


This works great - in the table view, I can see this lookup happening no problems (this substitutes the integer values 0/1 for the text values "Single"/"Married").


 


When I use the table as a datasource for a Report Details Datapage, I see the original value ("0"), not the looked-up one ("Single").  Is this by design?   How can I set the report to show the looked up value, not the original?


 


Thanks


Mark


Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

After letting this bubble around my brain for a while (which didn't take long  :) ) I solved it by just doing a SQL inner join in a calculated field:

SELECT name FROM fm_intervals WHERE fm_intervals.value = [@field:client1_income_interval]

Makes much more sense to do it this way - it is far more elegant and allows me to make changes to my table without having to change my datapage each time.

 

Link to comment
Share on other sites

  • 0

Hi Jan, thanks for the reply - yes that works, however only for the first looked up value in the view that is from the same lookup table.  

 

One of my tables uses duration/name pairs (e.g. 1/Yearly, 12/Monthly, 4/Quarterly, 365/Daily etc) and this is used multiple times on the datapage report detail (income and expenses for a client).  I can join the first duration entry fine (and it works) but subsequent ones result in a view with no data.

 

Caspio support suggest s using virtual fields and rules to hide or show the text; to me this isn't very elegant as it negates good database and programming practice for a lookup table rather than hard coding values

 

Thanks

Mark

Link to comment
Share on other sites

  • 0

I am also having this exact problem, so thanks for the reply Financemy.  Would you mind elaborating on the table and parameter structure in your example? What would push the @field parameter? Would it be coming from a field in the search section in the same datapage?  Sorry if these questions are dumb, I'm still a bit of a noob at SQL/caspio...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...