Related Records from Lookup field in Table

Hi, all!

I’m back to beg for more insight from you accomplished types.

Little background on what I’m trying to accomplish / the wall I’m running into:

 

I’m building a space for one of our programs where we connect senior citizens in need of day-to-day assistance to volunteers who can help them with their needs.

One of the services is providing car rides to doctor’s appointments. Since many of the doctors in the area see several of our clients, I’ve built a Doctor app that has the doctor’s office address, phone number, specialization, etc.

In the Client app (where the Senior’s information lives), there is a table of lookup fields where you can add multiple doctors (since someone might have a cardiologist and an oncologist and a general practitioner, etc.). The lookup field fills the doctor’s address, phone number, etc. 

Where I’m running into an issue is that I need a related records field in the doctor app where it pulls a list of all of the clients that use that doctor. For some reason, the related records field won’t look in the table for matches against the doctor’s name. 

 

Aside from ripping the lookup fields out of a table, having a set number of doctor spaces, and then having that same set number of different related records fields in each doctor app that checks against its respective lookup field, I’m not sure how to work around this. Any thoughts?

Hello Meg!

As you may know, this can’t be done with the default functions. However, using the Javascript, you can obtain and display the
data from an other app. The following is just a simple flow of how to do so.

-Create a blank space and specify an element ID of the blank space
-Using the Javascript, include the following processes in the handler of Record Details Event

  1. Using the REST API Request and the REST API (Get Record), obtain data from the Client App
  2. Display the record data obtained from the above process on the blank space.

Please use the following links to help you understand the processes stated above.

-kintone REST API
https://developer.kintone.io/hc/en-us/articles/212495188/

-Record Details Event
https://developer.kintone.io/hc/en-us/articles/213149167/

-Get Record (GET)
https://developer.kintone.io/hc/en-us/articles/213149287/

-Set the Button on a Blank space field
https://developer.kintone.io/hc/en-us/articles/212494708-Add-Buttons-Record-Details-#step2b

I hope this helps.

Hello, I have the same need as Meg and have a question. Using records.json from REST API to GET records, can you provide and example query string to search for values within a table?

Hi Abdul,

When you specify a field in a table in the query condition, it is the same as a regular query, and you can get it if you specify it as it is basically.

 

Here is an example coding if you want to retrieve a record that contains “ABC” in a Text field (field code: text), that is located in a table from App ID “10”.

 

        var parm = {

            "app":10

            "query":'text in ("abc")'

        }

       

        kintone.api('/k/v1/records',"GET",parm,function(e){

            console.log(e);

        });

 

However, please be aware that for the fields in a table, the operators you specify may change.

 

For your information, ” list of operators and functions that can be used with each field” for REST API are written in this following link.

 

https://developer.kintone.io/hc/en-us/articles/213149287/

Thanks.

Junko