今回は、Filter関数を使用してデータソース内のレコードを複数の条件でフィルタリングする方法を紹介します。
↓Filter関数の基本的な使い方はこちらの記事で紹介しています。
今回用意したデータソース
SharePointに「契約書管理台帳」というリストを用意しました。
列の種類
- 契約書番号:数値
- 契約書名:タイトル
- 契約先:1行テキスト
- 契約開始日:日付と時刻
- 契約終了日:日付と時刻
- 担当部署:1行テキスト
- 担当者1:1行テキスト
- 担当者2:1行テキスト
検索窓
今回は、こちらの検索窓を準備しました。
- 契約書番号:テキスト入力(数値)
- 契約書名:テキスト入力(テキスト)
- 契約先:テキスト入力(テキスト)
- 担当部署:テキスト入力(テキスト)
- 担当者1:テキスト入力(テキスト)
- 担当者2:テキスト入力(テキスト)
- 契約開始日:日付の選択
- 契約終了日:日付の選択
Gallery【Items】のコード
Filter(契約書管理台帳,
//契約書番号
IsBlank(Number.Text) || Number.Text = 契約書番号,
//契約書名
StartsWith(Title , Name.Text),
//契約先
StartsWith(契約先 , Company.Text),
//担当部署
StartsWith(担当部署 , Department.Text),
//担当者1
StartsWith(担当者1 , Manager1.Text),
//担当者2
StartsWith(担当者2 , Manager2.Text),
//契約開始日
'StartData-Start'.SelectedDate <= 契約開始日 || IsBlank(Text('StartData-Start'.SelectedDate)),
'StartData-End'.SelectedDate >= 契約開始日 || IsBlank(Text('StartData-End'.SelectedDate)),
//契約終了日
'EndData-Start'.SelectedDate <= 契約終了日 || IsBlank(Text('EndData-Start'.SelectedDate)),
'EndData-End'.SelectedDate >= 契約終了日 || IsBlank(Text('EndData-End'.SelectedDate))
)
ポイント
Filter関数は、結果が trueとなるレコードを返します。
Filter関数は、結果が trueとなるレコードを返すので、検索窓に何も入力していない時は、
全ての条件がtrueとなっていた方が良いです。
Falseとなっている条件が存在した場合、検索窓に何も入力していないのにも関わらずレコードが一つも表示されなくなります。
//契約書番号
IsBlank(Number.Text) || Number.Text = 契約書番号,
↓条件式を下の条件式に変更してみます。
//契約書番号
Number.Text = 契約書番号,
検索窓「契約書番号」が空欄だった場合、「Number.Text = 契約書番号」のみの条件式だと、Falseを返してしまい、
一つもレコードが表示されなくなってしまいます。
条件式の例
trueを返す条件式を紹介します。
テキスト入力(完全一致)
//契約書番号
IsBlank(Number.Text) || Number.Text = 契約書番号,
テキスト入力(完全一致)の場合は、IsBlank関数と組み合わせます。IsBlank関数は空白だった場合は、trueを返します。
テキスト入力(部分一致)
//契約書名
StartsWith(Title , Name.Text),
StartsWith関数は、検索窓「契約書名」が空だった場合、trueを返します。
日付の選択
//契約開始日
'StartData-Start'.SelectedDate <= 契約開始日 || IsBlank(Text('StartData-Start'.SelectedDate)),
'StartData-End'.SelectedDate >= 契約開始日 || IsBlank(Text('StartData-End'.SelectedDate)),
こちらも同様に、IsBlank関数と組み合わせることで空の場合、falseを返すのを回避できます。
まとめ
今回は、Filter関数を使用してデータソース内のレコードを複数の条件でフィルタリングする方法を紹介しました。
検索機能を充実させることで、社内のユーザーが使いやすいアプリを作っていきましょう!
コメント
コメント一覧 (279件)
Wow that was unusual. I just wrote an incredibly long comment but after
I clicked submit my comment didn’t show up. Grrrr…
well I’m not writing all that over again. Anyways,
just wanted to say superb blog!
My website :: バイナリーオプション
My spouse and I stumbled over here from a different web page and thought I may as well check things out.
I like what I see so now i am following you. Look forward to finding out about your web page repeatedly.
Take a look at my blog post … バイナリーオプション
magnificent points altogether, you simply gained a new reader.
What might you suggest in regards to your publish
that you made some days in the past? Any sure?
Feel free to visit my page: バイナリーオプション
Hello my friend! I want to say that this post is awesome, nice written and include approximately all important infos. I’d like to see more posts like this.
Tonic Greens: An Overview Introducing Tonic Greens, an innovative immune support supplement meticulously crafted with potent antioxidants, essential minerals, and vital vitamins.
The following time I read a weblog, I hope that it doesnt disappoint me as a lot as this one. I mean, I do know it was my option to learn, but I actually thought youd have one thing attention-grabbing to say. All I hear is a bunch of whining about one thing that you could possibly fix in case you werent too busy on the lookout for attention.
Hello just wanted to give you a quick heads up. The text in your content seem to be running off the screen in Safari. I’m not sure if this is a formatting issue or something to do with browser compatibility but I figured I’d post to let you know. The design and style look great though! Hope you get the issue solved soon. Many thanks
I am really enjoying the theme/design of your site. Do you ever run into any browser compatibility problems? A number of my blog visitors have complained about my site not operating correctly in Explorer but looks great in Opera. Do you have any solutions to help fix this issue?
Hello! Do you know if they make any plugins to help with SEO? I’m trying to get my blog to rank for some targeted keywords but I’m not seeing very good success. If you know of any please share. Thanks!
You made some good points there. I did a search on the topic and found most individuals will consent with your site.
I’ve been absent for some time, but now I remember why I used to love this site. Thanks , I¦ll try and check back more frequently. How frequently you update your web site?
I truly enjoy studying on this site, it holds fantastic blog posts.
My partner and I stumbled over here by a different page and thought I should check things out. I like what I see so now i’m following you. Look forward to checking out your web page for a second time.
What¦s Taking place i am new to this, I stumbled upon this I’ve found It absolutely helpful and it has aided me out loads. I’m hoping to give a contribution & help different customers like its aided me. Good job.
Hello! Someone in my Facebook group shared this site with us so I came to give it a look. I’m definitely enjoying the information. I’m bookmarking and will be tweeting this to my followers! Outstanding blog and great design and style.
This is the fitting blog for anybody who desires to find out about this topic. You understand so much its almost hard to argue with you (not that I really would want…HaHa). You undoubtedly put a brand new spin on a topic thats been written about for years. Nice stuff, just great!
Appreciate it for helping out, superb info .
lasuna drug – himcolin brand cheap himcolin online
Excellent blog here! Also your website quite a bit up very fast! What web host are you using? Can I get your associate link in your host? I wish my web site loaded up as fast as yours lol
It’s a shame you don’t have a donate button! I’d most certainly donate to this brilliant blog! I guess for now i’ll settle for bookmarking and adding your RSS feed to my Google account. I look forward to new updates and will talk about this site with my Facebook group. Talk soon!
Nice blog here! Also your web site loads up very fast! What web host are you using? Can I get your affiliate link to your host? I wish my web site loaded up as quickly as yours lol
buy cheap generic besifloxacin – purchase besivance eye drops buy sildamax without a prescription
order generic neurontin – brand azulfidine 500 mg order sulfasalazine 500mg online cheap
Write more, thats all I have to say. Literally, it seems as though you relied on the video to make your point. You clearly know what youre talking about, why waste your intelligence on just posting videos to your blog when you could be giving us something informative to read?
A lot of of whatever you say is astonishingly accurate and it makes me ponder why I had not looked at this in this light before. This particular article really did turn the light on for me as far as this issue goes. But at this time there is actually one particular factor I am not too comfortable with and while I make an effort to reconcile that with the main theme of the issue, let me observe exactly what the rest of the readers have to point out.Nicely done.
Sight Care reviews
Fit spresso reviews
buy benemid pills – tegretol 400mg generic buy generic tegretol 400mg
Cellucare
Lottery defeater software reviews
Sightcare
Fitspresso reviews
Sight Care
Nano defense pro reviews
Fitspresso review
Fitspresso review
celebrex without prescription – celecoxib over the counter indocin price
Lottery defeater software review
My brother suggested I would possibly like this web site. He used to be entirely right. This put up truly made my day. You can not believe just how so much time I had spent for this information! Thanks!
I do like the manner in which you have framed this specific challenge and it does provide me some fodder for thought. Nevertheless, from just what I have experienced, I just trust when the feedback pack on that folks stay on issue and don’t start upon a tirade associated with some other news of the day. Yet, thank you for this exceptional piece and while I can not really agree with it in totality, I regard your perspective.
Cellu care review
Cellucare review
Good ?V I should certainly pronounce, impressed with your web site. I had no trouble navigating through all tabs as well as related information ended up being truly easy to do to access. I recently found what I hoped for before you know it in the least. Quite unusual. Is likely to appreciate it for those who add forums or something, site theme . a tones way for your customer to communicate. Excellent task..
Sumatra Slim Belly Tonic
Lottery defeater
Fitspresso
Fitspresso review
Lottery defeater review
Lottery defeater system reviews
Opinipix paga