In a previous article I wrote about how to show Office365 users in the combo box and how to select users by default, but is there a way to select multiple users by default? I was asked how to do that, so I wrote down how to do that.
What we want to do
How to select by default
SearchUser V1
For all items (ForAll), use the SearchUser function to specify a default, similar to the singular selection I wrote about in the previous article.
Since the results of the SearchUser function are returned in a table (since there can be more than one search result), the First function is used to specify the first search result.
SearchUser V2
The SearchUser inside is now V2, and the return value of the SearchUserV2 function has added “.value”, but almost nothing else has changed.
※The default selection is still possible in SearchUserV1, but the versions should be matched.
Restore selections when multiple users’ information is contained in a single line of text
Consider an expression that restores this to the combo box.
SearchUser V1
Simply change the first argument of ForAll to the text split by Split.
The Filter inside will get rid of “empty array items” that may be created when splitting with the Split function.
SearchUser V2
As before, I just set the SearchUser inside to V2 and added “.value” to the return value of SearchUserV2.
コメント