cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

How to change a value in a nested InfoTable?

tlichtenberger-
1-Newbie

How to change a value in a nested InfoTable?

Good morning everyone!

I have got one instantiated DataTable which inherits from the DataShape with the shape: Item(String, primary key) and SubItem(InfoTable)

The SubItem-InfoTable has the shape: Name(String, primary key) and Location (Location: lat, long).

The Datatable offers some services to add/update/delete entries, and I have used them to manually (via testing the service) add Items and SubItems (because there are indeed static and will not change). The only thing that changes (dynamically) is the Location property in the nested SubItem-InfoTable  but I do not know how to change the location property of one specific SubItem-Entry (the entry will be specified by the Name).


I have already tried out the UpdateDataTableEntry/Entries-Services, but they would delete all the other SubItem-Entries which does not change.

That is one problem. The other problem is to change the entries dynamically in a custom service.


I have tried to write a service which gets 3 input-parameters: location(the new location), Item(the item which holds the SubItem in which the location must be changed), Name (for specifiying the SubItem-entry in which the location has to be changed.

The service starts like followed:

After the last line of code, I have to update the subitem-infotable with a new value but I do not know how to accomplish that.


I would be very thankful if anyone could lend me some help!

As always, thank you so much for your help! It is very much appreciated!

Best regards,

Theresa

2 REPLIES 2
ankigupta
5-Regular Member
(To:tlichtenberger-)

Hi Theresa Lichtenberger​,

As per my understanding; you will have to read the entry of DataTable in an object; let's say row.

So, row will have one property as SubItem-InfoTable.

Now make the changes to the Infotable using UpdateQuery Service.

var params = {

    t: undefined /* INFOTABLE */,

    query: undefined /* QUERY */,

    values: undefined /* INFOTABLE */

};

// result: INFOTABLE

var result = Resources["InfoTableFunctions"].UpdateQuery(params);

So, now row object has the updated Data.

Now use UpdateDataTableEntry to update the row entry in the Datatable.


Do let me know if you face any further issue.

Good morning Ankit Gupta​!

I think I finally got it. I will now try to visualize the various locations in a google maps widget and then I will see if it fully works.

Thank you so much!!

For those who might face a similar issue, I will show you my service:

Best wishes,

Theresa

Top Tags