Category: How do I do X?
Updated

This solution is summarized from an archived support forum post. This information may have changed. If you notice an error, please let us know in Discord.

How can I add to value to storeValue()?

Issue

I am trying to create an approval tool using Appsmith and REST API linkage with our in-house system. I want to save the output of a select value in the API request to a stored value called "approvallist". However, only the latest select values are being stored, and I want to continuously save all selected values. I have been struggling with this issue for over two weeks now and need help finding a solution.

Resolution

The user needs to create an approval tool through REST API linkage with their in-house system using Appsmith. They want to save the Select value output in API Request to ‘storeValue.approvallist()’. However, only the latest Select values are stored in the code they are using. They want to save the value continuously.

To solve this problem, the user needs to use multi select widget where they can select more than one value. They should rewrite their JS function to:

await storeValue('approvallist', Select_Users. selectedOptionValues.map(uId => {
const user = Select_Users.options.find(u => u.value === uId);
const { label, value } = user;
return ({ userinfo: label, uniqueId: value });
}), false);

This will store the selected values continuously.