Connectで、湖沼や河川、採集方法、タグの種類などの基本データを収集する魚のタグ付け調査を作成しています。繰り返しの中で、ユーザーは魚を1匹ずつ入力します。種は単一選択リストから選びます。直前に選択した種をデフォルト値にするにはどうすればよいですか?現場では、タブレットはほとんどの場合インターネットに接続できます。
I would experiment with a combination of indexed-repeat() and position(..)
Something like
indexed-repeat(${question}, ${repeat1}, position(..)-1)
You may need some logic for if there isn't any record in there checking count(repeat).
Also, fair warning, indexed-repeat doesn't work in the new versions of S123 yet (Studio and Mobile) per the documentation: Formulas—ArcGIS Survey123 | Documentation
他の投稿をいくつか読んでみたところ、Survey123 Connectに組み込まれているスクリプトタブを使えば、とても簡単にできることがわかりました!ほかの人の参考になればと思い、投稿します。質問が含まれている繰り返しグループの名前は「tagged_fish」で、対象フィールドは「species_sci_name」です。
Connectで新しいスクリプトにこれを挿入し、「repeat_species」と名付けました。
function sameaslast(tagged_fish, position, species_sci_name) {
if (position > 1){
return tagged_fish[position - 2][species_sci_name];
}
の中で 対象フィールドの計算列に、次の式を入力しました pulldata("@javascript", "repeat_species.js", "sameaslast", ${tagged_fish}, number(position(${tagged_fish})), "species_sci_name")
Yeah I'd still try my suggestion on this one, first. Messing with JavaScript is a pain.
JavaScriptも非公開の形式でしか利用できません。
JavaScriptを使わない解決策は、すべて循環冗長ループにつながるか、保守性の低い編集を伴います。
あなたのJavaScriptを見る限り、この件について@dougbrowning件の投稿を読んだようですね。
そうでなければ、こちらが最近の詳しいスレッドの一つです。
サインインすると、投稿したり、更新をフォローしたりできます。初めての方ですか?無料アカウントを登録しましょう。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.