---
title: "Preparing Data for Use with lfRestrictSelectOptions()"
canonical: "https://support.appfire.com/space/PSJ/15482054/Preparing%20Data%20for%20Use%20with%20lfRestrictSelectOptions()"
format: markdown
---
> Macro (aura-html)


Sometimes it makes sense to use lfRestrictSelectOptions() rather than lfAllowSelectOptions(), but the arrays you want to use are not easy to parse when using lfRestrictSelectOptions().

## Solution

By using arrayDiff(), the challenge of preparing the data for lfRestrictSelectOptions() is made easy. Consider the script below with a list of elements found in "fullArray". In the "allow" array, these are custom field options I wish the user to see. When arrayDiff() is used, this returns all the options which would be removed by lfRestrictSelectOptions().

|  |
| --- |
| ```
string [] fullArray = "allow1|remove1|allow2|remove2|allow3|remove3";
string [] allow = "allow1|allow2|allow3";
string [] restrict = arrayDiff(fullArray, allow);
 
runnerLog(restrict);
``` |

This returns the following in the SIL Manager console:

|  |
| --- |
| ```
remove1|remove2|remove3
``` |


[Here is the documentation for arrayDiff()](https://appfire.atlassian.net/wiki/spaces/SIL/pages/16521706).

[lfRestrictSelectOptions()](https://confluence.cprime.io/display/JJUPIN/lfRestrictSelectOptions)

[lfAllowSelectOptions()](https://confluence.cprime.io/display/JJUPIN/lfAllowSelectOptions)

## Additional Help

Need help implementing this script? Talk to me directly to me by clicking on the bot on this page.

## Related articles



> Macro (contentbylabel)

> Macro (details)
> 
> | Related issues |  |
> | --- | --- |