I have a sql procedure which requires the following 3 values as input:
@sku varchar(10) = {{skus}}
@date varchar(10) = {{dates}}
@col_value varchar(10) = {{col_values}}
In Retool,
#1: SKUs come from a Multiselect components:
Example: Say These are skus: AB , BC and CD selected in the multiselect
Answer: @sku varchar(10) = sku_fetched IN ( SELECT convert(varchar, value) FROM string_split({{ slctItems.value }}, ',') )
is the above correct?
#2:There is a Legacy Table called LegacyTable whose column name contains dates, so we only fetch those column names here:
So, I used the transformer along with help from here: How to get only specific table columns? - #5 by dcartlidge
transformer:
return _.pull( {{ _.values(tableLegacy5.columns) }}, "Account_ID","Product_ID","Bulk_Update" );
The above transformer returned required column names.
Answer: @date varchar(10) = dates IN ( SELECT convert(varchar, value) FROM string_split({{transformer.value}}, ',') )
is the above correct?
#3: From the same LegacyTable @col_value denotes the value of each of the column names in #2:
For example: Column name is: 2023-04-23 and its value is 0
Then how to correctly fetch and pass these values and they are editable in table?
In the end I'm updating them in the db.
Do I need specific loops for the query for processing something like this: @sku varchar(10) = sku_fetched IN ( SELECT convert(varchar, value) FROM string_split({{ slctItems.value }}, ',') )
or it is auto handled?