Scenario: User wants to bulk edit rows of data which have been stored in MariaDB. User is presented with data (ranging upto 150 rows) in an editable grid. The first column in the editable grid is a picker field whose suggestFunction calls an external REST API. When the user loads the page (clicks "edit" record), will the REST API be invoked per row of the editable grid?
Discussion posts and replies are publicly visible
How much data does this API return? The API will only be called as the user interacts with that picker field.
Each call returns a very small amount of data. About 7 key:value pairs. 6/7 have a max length of 10 char, one can be about 40 chars.
But, when the page loads, wont the custom picker field have to invoke the suggestFunction for all the picker fields? I was thinking that the call to the suggestFunction is how the picker is validating the data
Suggestion function will be invoked for each custom picker field when the user will interact.
Correct. Will it be only on interact or even when the page loads? Basically, what I am trying to figure out is the following:1. User clicks on "Edit" and is presented with a grid with 100 rows in an editable grid.
2. On page laod, will the API underneath the suggestFunction be invoked 100 times for the 100 rows? OR another way to think about this - let's say the suggestFunction is getting its information from a database call. In that instance, will it invoke the DB query 100 times?
I ask because the pickerField by default has to decide the validity of the value entered in it and my hunch is that it it will have to check with the data source if the value that was previously entered is valid
Stefan - just to confirm. Will I have to make a second call to the API in the saveInto to get the display label if the data and identifier parameters in the suggestFunction don't have the desired label?
Quick update - I selected the option to log integration calls. You both were right - the API won't be bulk invoked when the page loads. It will be invoked only when the user starts interacting with the picker field. This still presents an interesting challenge with the selected labels.
It depends a bit on how you return the data from the suggest function. The field "identifiers" is an ANY type. Means, that you can store a list of maps in there that can then include the actual identifier plus the display value. Check out my blog post where I describe how to allow adding new items from a custom picker.
appian.rocks/.../
Thank you! I had built something very similar to this. But, your guide is definitely very helpful. Thank you so much!